Mapping Drives

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

1

Comments

5 comments
Date Votes
  • net use "M:" \\server\share /p:yes
    

    I just did this in PDQ deploy and it worked for me

    1 2

    0
  • That's identical to what I'm doing except I didn't have the /p:yes. I added it and I still get a success in PDQ but it does not show mapped for me.

    I've disabled Symantec, I've installed another package to make sure it's actually communicating, I don't know. Is there a log somewhere I can use to start narrowing it down?

    0
  • To narrow down your search have you tried running net use Z: \server\share /persistent:yes' in a (non-administrator) CMD prompt on one of your targeted machines, to verify it runs for the logged on user.

    Another one to check, even though the package may be set to "Run As: logged in user" you can override/change this in when deploying, confirm that it is also set correctly in the deployment window

    enter image description here

    1
  • I'm trying on my computer and it isn't working. If I run it manually, locally, it works.

    0
  • Try using this PowerShell cmdlet. If it's failing for some reason it should give you better errors.

    New-PSDrive -Name "Z" -Root "\\server\share" -PSProvider "FileSystem" -Persist -Scope "Global"
    
    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post