Jump to content

Recommended Posts

Posted (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 by Erlend
Posted

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)
Posted

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.

Posted (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 by Erlend
Posted

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
Posted

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

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
  • Recently Browsing   0 members

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