I am trying to copy an exe file to a remote computer and run it with a cmd script from SCCM. The log shows that the exe is copied and ran successfully but when I look at the machine, the file is neither copied or ran. I have tried several variations of my script so I am wondering if there is something about SCCM that just will not do it.

My script is as follows:

copy "%~dp0CM_Log.exe" "%temp%"
cd %temp%
CM_Log.exe /s /SMS
exit

Can anyone point me in the right direction? I honestly feel like I am overlooking something VERY simple... which I hate.

Any assistance is greatly appreciated.
Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

1
What user context are you running the program calling the script in?

By default it will run in the System context and therefore %temp% will be the System one. Try changing the program to run with User rights and see if it's copied into the logged on users %temp% folder.
Answered 02/16/2012 by: andys0123
Orange Belt

Please log in to comment
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Ran it with user rights instead of system and that worked. THank you.
Answered 03/09/2012 by: nkennelly
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity