I need to run an exe remotely using psexec

I want to run CCMClean.exe from a server on a remote PC, I need to remove SCCM from the PC and remove the CCM folders under Windows. If someone has a script (Powershell or VB) or even a bat file that would be great.

Just in case I was not clear. CCMClean is on a server  \\servername\client\ccmclean.exe  
And I want to run that on a remote PC to remove SCCM.
LVL 19
Edward PamiasTeam Lead RRS DeskAsked:
Who is Participating?
ITSysTechSenior Systems AdministratorCommented:
C:\psexec.exe \\ -u domainname\administrator -p 12345 -d -e -i \\\ccmclean.exe = remote server you want to have this work on = location were the file is most likely a shared folder

-d      Don't wait for process to terminate (non-interactive).
-e      Does not load the specified account’s profile.
-i      Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.

Edward PamiasTeam Lead RRS DeskAuthor Commented:
this is good. Thanks!
ITSysTechSenior Systems AdministratorCommented:
Your welcome. :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.