Jump to content

Recommended Posts

  • Moderators
Posted

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

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.

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

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
×
×
  • Create New...