Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Cannot run AutoIT script as a program in Microsoft System Center

Avatar of eng_bci
eng_bci asked on
Scripting LanguagesInstallationMicrosoft Server Apps
2 Comments1 Solution658 ViewsLast Modified:
We are running Microsoft System Center 2007.  We have the CCM agent installed on our machines and they have UAC enabled.  We run MSIs with no problem on machines frequently using the CCM agent, we also run Shell commands on machines frequently with no issues using the "ShellExecuteWait" function.

I am trying to run a simple AutoIT script to remove some directories and files from a machine.  If I run this script on my own machine using a Local Administrator account it works perfectly.  If I set it up as a program in SCCM and advertise it to a machine it works up to the point of execution and then hangs.

There doesn't seem to be any problem on SCCM:
The package is copied to the remote machine
CCMexec.exe runs the script
The script "sticks" on execution and never finishes... you can see it running as System in task manager.

Why does this work on my machine using a Local Admin, but when I run it under the LSA account using CCMexec.exe it fails?  I think it may have something to do with the LSA not having a registry hive.  I've ran processexplorer on the hung process and it seems to indicate its waiting for user input as the process state displays "state:wrUserRequest".

The script is below:
#$ProgramPath="c:\Program Files (x86)\Program\Version1"
#IF FileExists ($ProcommPath)    Then
#   DirRemove ( "c:\Program Files (x86)\Program\Version1", 1)
#   DirRemove ( "c:\Program Files (x86)\Program", 1)
#   Exit(0)  
#Else
#   Exit(1605)
#EndIf  

Please don't respond with "why don't you do it using a MSI, or powershell script or ShellExecuteWait" or using some other function.  We know how to make this work using other methods.  We want to know why this won't work, or what we are doing wrong that is keeping it from working.

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Mike T
Mike TFlag of United Kingdom of Great Britain and Northern Ireland imageLeading Engineer
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers