Sign in to follow this  
Followers 0
hirsty2000

Script Help

2 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0