dreamzboy Posted December 18, 2010 Share Posted December 18, 2010 Hello,I have a simple noobie question. I've successfully mapped the network drive; however, I couldn't figure out how to automatically open that directory without having me browse to the directory that I just mapped.For example, I mapped "\\computer-name\folder" (without a drive letter). The script successfully mapped it, but how do I get that folder to open once it's mapped? If I manually mapped the network drive from my computer, assigned a drive letter, entered my credential, and when I clicked finish, the drive/folder shows up. I wanted to do the same but through a script so I don't have to manually map the drive and enter my credential every time.Thanks in advance for your help. Link to comment Share on other sites More sharing options...
flyingboz Posted December 18, 2010 Share Posted December 18, 2010 rtmDriveMapAdd()or search for RunReadStd() , and look at "net use"usual caveats about hiding usernames / passwords in scripts apply. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
dreamzboy Posted December 18, 2010 Author Share Posted December 18, 2010 rtm DriveMapAdd() or search for RunReadStd() , and look at "net use" usual caveats about hiding usernames / passwords in scripts apply. I've already looked at the DriveMapAdd feature. In fact, that's what I used right now and there's no mapped drive window pop up like the manual mapped drive. How do you hide usernames/password? I never could figure that out. Thanks! Link to comment Share on other sites More sharing options...
dreamzboy Posted December 23, 2010 Author Share Posted December 23, 2010 Bump...I know someone knows but doesn't want to share. Link to comment Share on other sites More sharing options...
Varian Posted December 23, 2010 Share Posted December 23, 2010 Why not just ShellExecute() the share...Local $Result, $Mapping = '\\Server\Share' $Result = DriveMapAdd('', $Mapping, 'UserName', 'password') Switch $Result Case 1 MsgBox(32, 'SUCCESS', 'Exit Code: ' & $Result) ShellExecute($Mapping, '', $Mapping, 'open') Case Else MsgBox(32, 'FAILURE', 'Exit Code: ' & $Result) EndSwitch Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now