path statement and deployments

when you deploy an application or package in cm2012 does it rely on the local system path to find anything?  Like msiexec.exe or powershell.exe?

April 29th, 2015 5:02pm

Hi,

Yes if you don't specify the full path to the .exe file for instance msiexec.exe the path must be in then System environment path for the SCCM client to be able to find it.

Regards,
Jrgen

Free Windows Admin Tool Kit Click here and download it now
April 29th, 2015 5:06pm

ok, that explains a lot.   So if I want to run a .PS1 script what do I actual enter on my Package Command Line?

C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe MyScript.ps1  ?    (this did not seem to work)

Since MyScript.ps1 is in a random folder in C:\windows\cache\  how do you specify it when your path is messed up?

April 29th, 2015 5:12pm

C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe .\MyScript.ps1

Although take a look at the following:

https://dynamicdatacenter.wordpress.com/2012/10/01/run-powershell-script-from-software-package/

Free Windows Admin Tool Kit Click here and download it now
April 29th, 2015 8:01pm

You can use below command based on the OS version : 

for 32bit OS ,command line looks something like this :

%windir%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file .\Myscript.ps1   If you want to run the powershell on 64bit machines, You can try below command. %windir%\Sysnative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file .\Myscript.ps1 
April 29th, 2015 8:14pm

We deployed a WebEx client software to all of our workstations.  After that our system PATH was no longer a reg_expand_sz  it was changed to a reg_sz registry type and our deployments don't work. Also, if you open up a cmd window and type in any command (calc, msiexec) it can't find them.  you have to CD Windows\System32 and then the command works.

What is very odd is I have setup a machine and then manually installed the WebEx software and the reg key did not change.   So I'm not thinking this is malware.

Question:  if you run a PowerShell script via a Computer GPO does that too require a healthy path?   If it does I'll have to use psexec to find our whole environment :-(

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 10:12am

You don't require the path if you are specifying the full path manually via your script.

e.g C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file .\Myscript.ps1

This will work on both 32 and 64 bit devices calling the 32bit version of PowerShell.

On different machines you will have different entry's in the path statement as different installers append , prefix their own path info.

April 30th, 2015 10:18am

how about if you need to run a .CMD file?   what I've done in the past is this:    I have a .CMD file that does some stuff and then uses %~dp0 to call a .EXE or .MSI from the c:\windows\cache\xyz folder.

What I just tried was this.   

and when I run this it fails with this error message.

so how do I run this so it works?  

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 12:31pm

In the command line window you just posted you just need to put InstallCitrix.cmd

I usually just hit browse and select the file directly, saves any typos

April 30th, 2015 12:35pm

that worked.   I was worried since the target machine I deployed too has the incorrect PATH key 'type' yet CM2012 was still able to deploy.  I did notice that it took about 30 min vs 5.  I force a machine policy update yet it still took a long time.  and I did the force 4 times.

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 1:21pm

It's always worth looking at the log files as you send something out so you can track it in real time.

for packages have a look at execmgr.log on the client.

I just snapped a Win 7 VM back to build day and had a look at the path info.

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
Remember some applications add their own data to the path though.

April 30th, 2015 3:55pm

It's always worth looking at the log files as you send something out so you can track it in real time.

for packages have a look at execmgr.log on the client.

I just snapped a Win 7 VM back to build day and had a look at the path info.

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
Remember some applications add their own data to the path though.

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 7:54pm

You don't require the path if you are specifying the full path manually via your script.


Script ,yes ,it doesn't required but i meant was the cmd line instead of script.
May 4th, 2015 10:27pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics