Jump to content

RunASWait With variable from ini file


Erlend
 Share

Recommended Posts

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 by Erlend
Link to comment
Share on other sites

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

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

  • Developers

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

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 by Erlend
Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...