Jump to content

Script Help


Recommended Posts

I have written the script below to enable me to install some software however I am having trouble with the final section - which I have highlighted red.

If I type this into a command prompt it will run fine, but through the script it will not run.

Any suggestions?

Thanks

WinMinimizeAll ()

Dim $1

$PID = ProcessExists("outlook.exe") ; Will return the PID or 0 if the process isn't found.

SplashTextOn("Penna Install Service", @CRLF & "THIS MACHINE IS BEING UPDATED WITH NEW SOFTWARE." & @CRLF & @CRLF & "Do not use this machine until all windows have closed successfully!" & @CRLF & @CRLF & "Please report any errors to the IT Representative in accordance with" & @CRLF & "the schedule in the installation instructions.", 700, 130, -1, 10, 16, "Arial", 8, 600)

If $PID Then ProcessClose($PID)

Sleep(1000)

RunAsSet ("Username", "Domain", "Password")

Sleep(1000)

RunWait(@ScriptDir & "\software\p_client.exe")

Sleep(1000)

RunWait(@ScriptDir & "\software\printer.exe")

Sleep(1000)

RunWait(@ScriptDir & "\software\outlook.exe")

Sleep(1000)

RunWait(@ScriptDir & "\software\xcacls.exe c:\docume~1\alluse~1\applic~1\interw~1 /t /e /g Everyone:c /y")

RunWait(@ScriptDir & "\software\xcacls.exe c:\docume~1\alluse~1\applic~1\interw~1\*.* /t /e /g Everyone:c /y")

Sleep(1000)

SplashOff()

RunAsSet ()

Link to comment
Share on other sites

RunWait(@ScriptDir & "\software\xcacls.exe c:\docume~1\alluse~1\applic~1\interw~1 /t /e /g Everyone:c /y")

RunWait(@ScriptDir & "\software\xcacls.exe c:\docume~1\alluse~1\applic~1\interw~1\*.* /t /e /g Everyone:c /y")

<{POST_SNAPBACK}>

Taking the commands you have in red and the hint that the CMD prompt works fine:

RunWait(@ComSpec & ' /c ' & @ScriptDir & '"\software\xcacls.exe c:\docume~1\alluse~1\applic~1\interw~1 /t /e /g Everyone:c /y"',"",@SW_HIDE)

WinWaitExsist($xcacls)
WinWaitClose($xcacls)

RunWait(@ComSpec & ' /c ' & @ScriptDir & '"\software\xcacls.exe c:\docume~1\alluse~1\applic~1\interw~1\*.* /t /e /g Everyone:c /y"',"",@SW_HIDE)

WinWaitExsist($xcacls)
WinWaitClose($xcalcs)

Try that and see if it works.

Keep in mind that the RunWait is only for the dosbox at this point so the extra WinWaitClose() may be required.

Edit: Corrected RunWait syntax. Forgot the null for the working directory

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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...