/build/static/layout/Breadcrumb_cap_w.png

Using a script file to copy an exe file and execute

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.

0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: andys0123 12 years ago
Orange Senior Belt
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.
Posted by: nkennelly 12 years ago
Senior Yellow Belt
0
Ran it with user rights instead of system and that worked. THank you.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ