I understand this isn't the best way to go about mapping drives, but it's what i need to do. I'm banging my head against the wall because I can't figure out what I am doing wrong. I have it set to run as logged in user and have attempted with both CMD and PS.
I've tried pushing the "net use Z: \server\share /persistent:yes" with and without the persistent part. It will say successful the first time, but there is no drive mapped. If I try again, it fails because it says it's already there. If I log out and back in, I'm able to "successfully" push again with the prior result.
Trying with a bat file, I get the following error -
C:\WINDOWS\AdminArsenal\PDQDeployRunner\service-1\exec>reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v NetDriveMap /t REG_SZ /d "net use Z: \server\shares\it /persistent:yes"
ERROR: Invalid syntax.
Type "REG ADD /?" for usage
Please sign in to leave a comment.