Brentp Posted May 27, 2015 Share Posted May 27, 2015 Hi all,There is a few net use scripts to map a drive,but What I want to do is replace bat file which was a shortcut on the users desktop and it connected to a non domain server with a username and password from the non domain server, and then launch a program from that server. (Its not mapping the drive its just making a connection so it can run the app)Currently the users have this bat file that they runecho off net use \\Server1 password /USER:user start \\Server1\APP\App.exeWhat I want to do is create a script that does the same thing and then compile it so the credentials are not accessible This is the closest thing I can find, but I couldn't get it to work,Any ideas?Thanks Link to comment Share on other sites More sharing options...
AdamUL Posted May 29, 2015 Share Posted May 29, 2015 Look at DriveMapAdd with a empty string for the drive letter. This will just make a connection, and not map a drive. Also, since the server is not on the domain, the domain for the user name will be the server name itself. Give this a try. Global $sServer = "Server1" Global $sShare = "\\" & $sServer & "\APP" Global $sAppPath = $sShare & "\App.exe" Global $sUserName = "user" Global $sPassword = "password" DriveMapAdd("", $sShare, 0, $sServer & "\" & $sUserName, $sPassword) Run($sAppPath) Adam 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