Sign in to follow this  
Followers 0
JLogan3o13

Question about running scripts remotely

4 posts in this topic

I have a question about running scripts on remote computers. I have a number of scripts for the uninstall of unapproved software. Most of this software is bloatware that cannot be uninstalled via msiexec (toolbars, freeware, etc.). So I script through the dialog boxes of the uninstall, and then delete any leftover files and reg entries afterward (locking out user interaction while the script is running). The scripts work fine on my local computer, and I can even drop them into the root of C: on a remote PC, and then create a RunOnce registry entry to run them at the next logon.

However, I have been attempting to run them immediately by dropping the executable on the remote machine and then running a tool like psexec, or by running the AT command to create a scheduled task. Unfortunately, in either case, the UI does not come up when the script runs. I can see the script running under the Task Manager, but no windows come up and the script just hangs. I've tried running under different credentials, including SYSTEM, as well as running under different sessions (Windows, Console, etc.). Nothing seems to be working. Any suggestions would be greatly appreciated.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites



You need to use the session parameter in the case of psexec. Your script needs to interact with the console session so you can see program GUIs.

I think it was 0 for XP and 1 for Vista and up.

Share this post


Link to post
Share on other sites

Thanks, I tried using the session ID, but it still didn't work.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

For PSEXEC, you need to use the -i option to allow the process to interact with the desktop. I have used beyondexec and psexec, they both have the same -i option, without any problems.

Edited by AdamUL

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