autoscripterwin Posted May 13, 2019 Share Posted May 13, 2019 Hey I want to run an exe on a network drive but it doesnt work. How can I map my network drive and run the exe? Network drive is: \\test\software$ Link to comment Share on other sites More sharing options...
BrewManNH Posted May 13, 2019 Share Posted May 13, 2019 DriveMapAdd will add the drive, but you shouldn't need to map a drive to run the program, just use the UNC path and filename in your Run command. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
autoscripterwin Posted May 13, 2019 Author Share Posted May 13, 2019 but I need the privileges of an specific user to execute it so I need the mapping, dont I? Link to comment Share on other sites More sharing options...
autoscripterwin Posted May 13, 2019 Author Share Posted May 13, 2019 (edited) $MapDrv = DriveMapAdd("S:", "\\test\software$", $DMA_DEFAULT, "ase\test", "password") Run($MapDrv& "\Avira\antivir_security_management_center_de\AntiVir_Security_Management_Center_Agent_de.exe") i tried this but it doesnt work Edited May 13, 2019 by autoscripterwin Link to comment Share on other sites More sharing options...
BrewManNH Posted May 13, 2019 Share Posted May 13, 2019 When you map a drive as a specific user that's not the current user, you need to use RunAs. You can still use RunAs without mapping the drive and just use the correct credentials and the UNC path. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Subz Posted May 13, 2019 Share Posted May 13, 2019 Or use built-in Net Use (untested) RunWait(@ComSpec & ' /c Net Use S: /Delete&&Net Use S: "\\test\software$" /USER:"ase\test" "password"', "", @SW_HIDE) Link to comment Share on other sites More sharing options...
BrewManNH Posted May 13, 2019 Share Posted May 13, 2019 11 minutes ago, Subz said: Or use built-in Net Use (untested) Why? There's an AutoIt function for that, that does the same thing, and is just as unneeded. Just use RunAs with the UNC path as I explained above. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
autoscripterwin Posted May 14, 2019 Author Share Posted May 14, 2019 thank you very much, do you have an example for the runas function? I dont really understand the function signature Link to comment Share on other sites More sharing options...
Earthshine Posted May 14, 2019 Share Posted May 14, 2019 Look it up in the help file and look at the examples and run them from the help file for examples My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
rudi Posted May 17, 2019 Share Posted May 17, 2019 Hi. EXE files usually can be executed directly from an UNC path, like \\test\software$\MyProg.exe so you might want to test if you really need a mapped drive letter. hidden Shares IMHO are self-deception in aspects of security. Simply use a CMD box and type: net view \\test /all If the program will run "as-the-currently-loggedon-user" and that one has access rights to that share \\test\software$, then you do not Need to specify user credetials. Windows will always try to use the currently logged on user. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
BrewManNH Posted May 17, 2019 Share Posted May 17, 2019 On 5/14/2019 at 2:24 AM, autoscripterwin said: I dont really understand the function signature What parts don't you understand? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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