Question : Deploying iTunes 9.2 using SCCM and CMD file?

Hi,

Hoping somebody can clear up some confusion I'm having with regards to pushing out iTunes with SCCM using a cmd file.

I've followed this guide here:
http://www.windows-noob.com/forums/index.php?/topic/2011-howto-install-itunes-using-sccm/

To sum up, I'm using a cmd file (which I've attached) that initiates the msi installs with msiexec. I'm then wanting to push this out to the needed machines via SCCM.

In the package setup within SCCM I'm using the command cmd /c InstalliTunes.cmd however when trying to deploy its trying to run in the C:\Windows directory (I've read about the limitations with UNC style network paths) but don't quite understand how to get around this.

Following the instructions in the above tutorial works well right up until the point where it executes the cmd file on the local machine. It downloads the MSI files for iTunes + quicktime (and device drivers.msi etc) but the command doesn't run as its not in the correct directory. I've attached the error message from execmgr.log
CommandLine = "\"C:\\WINDOWS\\system32\\cmd.exe\" /c installitunes.cmd";

I've done a fair bit of reading on how to deploy cmd files and bat files via SCCM but I still don't quite understand the "best practice" for doing it. As it currently stands I can get around the above limitation by copying the installiTunes.cmd file to the local machines C:\Windows directory, but there has got to be a better way of doing it?

In SCCM if I just enter InstalliTunes.cmd in the command section (as opposed to cmd /c InstalliTunes.cmd) it doesn't seem to do anything on the local machine. And there aren't any indications in the execmgr log file apart from the following:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
AdvertisementId = "XXX20018";
	ClientID = "GUID:XXXXX-CBEA-405B-A2B6-0B18F70F79B9";
	CommandLine = "\"C:\\WINDOWS\\system32\\CCM\\Cache\\SCC00021.1.S-1-5-21-2072974133-2127642462-1908750753-657351853\\InstallItunes.cmd\"";
	DateTime = "20100622015805.935000+000";
	MachineName = "ComputerX";
	PackageName = "XXX00021";
	ProcessID = 2088;
	ProgramName = "iTunes 9.2 Update";
	SiteCode = "XXX";
	ThreadID = 380;
	UserContext = "NT AUTHORITY\\SYSTEM";
	WorkingDirectory = "C:\\WINDOWS\\system32\\CCM\\Cache\\SCC00021.1.S-1-5-21-2072974133-2127642462-1908750753-657351853\\";
};
]LOG]!><time="11:58:05.935+-600" date="06-22-2010" component="execmgr" context="" type="1" thread="380" file="event.cpp:525">
<![LOG[Raised Program Started Event for Ad:XXX20018, Package:XXX00021, Program: iTunes 9.2 Update]LOG]!><time="11:58:05.935+-600" date="06-22-2010" component="execmgr" context="" type="1" thread="380" file="executioncontext.cpp:523">
<![LOG[Program exit code 0]LOG]!><time="11:58:08.199+-600" date="06-22-2010" component="execmgr" context="" type="1" thread="660" file="scriptexecution.cpp:547">
<![LOG[Looking for MIF file to get program status]LOG]!><time="11:58:08.199+-600" date="06-22-2010" component="execmgr" context="" type="1" thread="660" file="executionstatus.cpp:282">
<![LOG[Script for  Package:XXX00021, Program: iTunes 9.2 Update succeeded with exit code 0]LOG]!><time="11:58:08.199+-600" date="06-22-2010" component="execmgr" context="" type="1" thread="660" file="executionstatus.cpp:259">
<![LOG[Raising event:
[SMS_CodePage(850), SMS_LocaleID(3081)]
instance of SoftDistProgramCompletedSuccessfullyEvent


In addition to the above in my package setup I've got "This package contains source files" which is pointed to my network share, I've also got "Always obtain files from the source directory" ticked and in the Advertisement properties "Download content from distribution point and run locally" ticked.

My question, can anyone advise the best way of running CMD/BAT files using SCCM and point out any silly things I may have missed? Should I be looking at using a drive letter as opposed to UNC style paths?

Your help would be greatly appreciated. Although I can get the package to deploy by copying the cmd file to the machines, I'd like to do it properly.
:)

Cheers.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
AdvertisementId = "XXX20017";
	ClientID = "GUID:XXXXX-CBEA-405B-A2B6-0B18F70F79B9";
	CommandLine = "\"C:\\WINDOWS\\system32\\cmd.exe\" /c installitunes.cmd";
	DateTime = "20100618021624.329000+000";
	MachineName = "ComputerX";
	PackageName = "XXX00021";
	ProcessID = 1952;
	ProgramName = "Install iTunes 9.2 and Quicktime";
	SiteCode = "XXX";
	ThreadID = 4144;
	UserContext = "NT AUTHORITY\\SYSTEM";
	WorkingDirectory = "C:\\WINDOWS\\system32\\CCM\\Cache\\SCC00021.1.S-1-5-21-2072974133-2127642462-1908750753-657351853\\";

Answer : Deploying iTunes 9.2 using SCCM and CMD file?

That's a pretty good article on iTunes deployment.  

I've never had an issue running a .bat file from the 'Command Line' of a SCCM program.  Perhaps using .bat instead of .cmd will help solve your issue.

'Program: iTunes 9.2 Update succeeded with exit code 0'  seems to indicate that the SCCM client was able to download and execute the file.  In the windows-noob.com BAT example the code always returns '0' (that's what 'exit 0' does).  So, even if one of the MSIs fail the BAT file will always return a 'success' message to the SCCM client.

This is a tricky issue and the only way I've been able to look into the issues is to log all of the MSI installs.

For example "msiexec /i iTunes9.1.1.12.msi /qn /norestart /log c:\isdept\iTunes9.1.1.12.log"  will create a log file when the MSI is installed.

Also,

UserContext = "NT AUTHORITY\\SYSTEM";  implies that the SCCM client is executing the bat/cmd file as the local system user.  It is unlikely that this user has access to the files if they are on a UNC path (as the windows-noob.com article suggests).

Random Solutions  
 
programming4us programming4us