Erlend Posted January 29, 2009 Share Posted January 29, 2009 (edited) Hello I am trying to use RunASWait with iniread: Dim $app $app = IniRead("s:\vismakiller\config.ini", "SERVERS", "app", "NotFound") MsgBox(4096, "App er:", $app) If Not IsAdmin() Then RunAsWait('user_', "domain_", 'password_', 0, $app , @SW_MAXIMIZE) EndIf Whan do i have to do to get the variable to work inn the RunAsWait command? Edited January 29, 2009 by Erlend Link to comment Share on other sites More sharing options...
azure Posted January 29, 2009 Share Posted January 29, 2009 Hello I am trying to use RunASWait with iniread: Dim $app $app = IniRead("s:\vismakiller\config.ini", "SERVERS", "app", "NotFound") MsgBox(4096, "App er:", $app) If Not IsAdmin() Then RunAsWait('user_', "domain_", 'password_', 0, $app , @SW_MAXIMIZE) EndIf Whan do i have to do to get the variable to work inn the RunAsWait command? Hmm?? RunAsWait('user', 'domain', 'password', 0, 'C:\path\to\my\command.exe ' & $variable, @SCRIPTDIR, @SW_MAXIMIZE) Link to comment Share on other sites More sharing options...
Erlend Posted January 29, 2009 Author Share Posted January 29, 2009 Hmm?? RunAsWait('user', 'domain', 'password', 0, 'C:\path\to\my\command.exe ' & $variable, @SCRIPTDIR, @SW_MAXIMIZE) ok, but the command i wish to run is the variable that i read from the ini file. is it posible to execute this? Link to comment Share on other sites More sharing options...
Erlend Posted January 29, 2009 Author Share Posted January 29, 2009 Dim $appdir $appdir = IniRead("s:\vismakiller\config.ini", "SERVERS", "appdir", "NotFound") MsgBox(4096, "App er:", $appdir) If Not IsAdmin() Then RunAsWait('user_', "domain_", 'password_', 0, $appdir & '\vismakiller.exe') MsgBox(0, "Info", "Ferdig!") EndIf What is wrong with the formatation of this scipt? I can't work out how i can format the $appdir variable, the .ini file value looks like this \\server_\share$\_folder\ the vismakiller.exe application is in this folder. Link to comment Share on other sites More sharing options...
Aceguy Posted January 29, 2009 Share Posted January 29, 2009 what does your inifle look like. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Developers Jos Posted January 29, 2009 Developers Share Posted January 29, 2009 Where is this script stored? (in other words: what is your working directory and is that available for the shelled application?) SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Erlend Posted January 29, 2009 Author Share Posted January 29, 2009 (edited) INI file: [SERVERS] appdir=\\server\share$\ The exe file is caled initkill.exe an is used to launch (from UNC path) vismakiller.exe as an user with administrator rights. For the normal user the initkill is stores at s:\vismakiller\ Vismakiller copy's some files and launch psexec to launch another script at a remote server. i need to use the iniread because the same application is used against different serveres and shares. Edited January 29, 2009 by Erlend Link to comment Share on other sites More sharing options...
Erlend Posted January 30, 2009 Author Share Posted January 30, 2009 solved: Opt("TrayIconHide", 1) Dim $appdir $appdir = IniRead("s:\vismakiller\config.ini", "SERVERS", "appdir", "NotFound") If Not IsAdmin() Then RunAsWait('user_', "domain_", 'password_', 0, @ComSpec & " /c " & '"' & $appdir & '"', "", @SW_HIDE) EndIf Link to comment Share on other sites More sharing options...
Erlend Posted January 30, 2009 Author Share Posted January 30, 2009 solved: Opt("TrayIconHide", 1) Dim $appdir $appdir = IniRead("s:\vismakiller\config.ini", "SERVERS", "appdir", "NotFound") If Not IsAdmin() Then RunAsWait('user_', "domain_", 'password_', 0, @ComSpec & " /c " & '"' & $appdir & '"', "", @SW_HIDE) EndIf 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