I'm coding a small application which can be seen here that executes a net.exe command in cmd to add a network location as a drive. (I'm only linking my coding question incase it relates somehow and someone wants to contribute over on stackoverflow.)
net use z: \\PCName\d$\Folder1\Folder2
I'm currently having issues with the command executing through my application not behaving as it should. By that I mean cmd indicates the command executed as it should have but not action has actually taken place:

However when I enter my command manually it behaves as you would expect:

When I add drive through my application nothing is added and when I enter the command myself through cmd the drive appears in Windows Explorer.
At first I thought it might be a coding issue but after struggling with the problem I think my application is rather sound. Now I am on the train of thought that it might be Windows or another application behaving oddly.
It might be worth noting that I am at work where there is a lot of network policy and security however I do have permission to access and drives.
Could it be Windows, an application or my network causing this behavior or should that not be the case?