ahtshun83 Posted October 14, 2013 Report post Posted October 14, 2013 Hi All, I trying to run a simple bat file via SCCM 2007. However I couldnt make it run on client machine. This is my bat file @ECHO OFFECHO %0PAUSE Under command line, i did try cmd.exe /c batfile.cmd. i also configured to run program from DP. Anyone can assist me? Quote Share this post Link to post Share on other sites More sharing options...
Bendes Posted October 14, 2013 Report post Posted October 14, 2013 Have you tried the simpliest way without "cmd.exe" ? batfile.cmd or batfile.bat Quote Share this post Link to post Share on other sites More sharing options...
ahtshun83 Posted October 14, 2013 Report post Posted October 14, 2013 Have you tried the simpliest way without "cmd.exe" ? batfile.cmd or batfile.bat I did try without cmd.exe on .cmd file and it failed. I just tried without cmc.exe on .bat file and it throw me error " The pogram cannot be run because the program file cannot be found". I checked..all the files are present. Quote Share this post Link to post Share on other sites More sharing options...
Bendes Posted October 14, 2013 Report post Posted October 14, 2013 - Your batfile.cmd is present at the root of your "source" package folder ? - Are your sources replicated to your DP's ? Quote Share this post Link to post Share on other sites More sharing options...
ahtshun83 Posted October 14, 2013 Report post Posted October 14, 2013 - Your batfile.cmd is present at the root of your "source" package folder ? - Are your sources replicated to your DP's ? Yes at the root of the package. I did distribute to DP. I tried both settings - configured to run program from DP - download from DP and run program locally. Both settings didn't work Quote Share this post Link to post Share on other sites More sharing options...
Bendes Posted October 14, 2013 Report post Posted October 14, 2013 Last idea : C:\Windows\System32\cmd.exe /c batfile.cmd Quote Share this post Link to post Share on other sites More sharing options...
ahtshun83 Posted October 14, 2013 Report post Posted October 14, 2013 Last idea : C:\Windows\System32\cmd.exe /c batfile.cmd so i put this command at the command line field? do i need to enclose with " "? Quote Share this post Link to post Share on other sites More sharing options...
Bendes Posted October 14, 2013 Report post Posted October 14, 2013 so i put this command at the command line field? Yes do i need to enclose with " "? No Quote Share this post Link to post Share on other sites More sharing options...
ahtshun83 Posted October 14, 2013 Report post Posted October 14, 2013 Hi Bendes, tried with or without "" on either run on dp and dl and run locally..all not working..i'm not sure whats went wrong ..i thought it is simple to just run a bat file from SCCM 2007...guess no luck for me.Thanks for your help ..appreciated it. Quote Share this post Link to post Share on other sites More sharing options...
Rocket Man Posted October 14, 2013 Report post Posted October 14, 2013 What exactly is the purpose of the batch file? Does it initiate a software install? Quote Share this post Link to post Share on other sites More sharing options...
Bendes Posted October 14, 2013 Report post Posted October 14, 2013 It's must be as simple as you say... Have you check the log files on your client C:\Windows\CCM\Logs (sort it by last modification) ? Quote Share this post Link to post Share on other sites More sharing options...
bramk Posted October 14, 2013 Report post Posted October 14, 2013 If you check the c:\windows\system32\ccm\cache folder, all files are in it as expected? other packages do work, to confirm you don't have a boundary issue? Quote Share this post Link to post Share on other sites More sharing options...
ahtshun83 Posted October 16, 2013 Report post Posted October 16, 2013 If you check the c:\windows\system32\ccm\cache folder, all files are in it as expected? other packages do work, to confirm you don't have a boundary issue? Yes other packages are working and all files are downloaded correctly to DP Quote Share this post Link to post Share on other sites More sharing options...
ahtshun83 Posted October 16, 2013 Report post Posted October 16, 2013 What exactly is the purpose of the batch file? Does it initiate a software install? at first i intended to run a VB script to copy two files but it didn't run. So i thought of using a bat file to call this vb script. This is my actual bat file ?cscript "%~dp0Msgbox.vbs" echo %~dp0 Quote Share this post Link to post Share on other sites More sharing options...
bramk Posted October 16, 2013 Report post Posted October 16, 2013 How do you set the program in the package program command line? You can run the .VBS directly without the cscript /via a batchfile. sourcepath enters the level where the vbs is placed? Quote Share this post Link to post Share on other sites More sharing options...
Rocket Man Posted October 16, 2013 Report post Posted October 16, 2013 Why not use a run command line step like this and simply reference the package that contains the 2 files xcopy ".\*.*" "c:\your_specified_directory" /D /E /C /I /Q /H /R /Y /S This will work without the use of scripting! Or if you dont want to do it via a task sequence a batch file (nameofbatch.bat) like this would do the trick: copy %~dp0file1 "C:\Your_specified_directory" /y copy %~dp0file2 "C:\Your_specified_directory" /y Have the 2 files in a package along with the batch file and the program command line will be nameofbatch.bat Quote Share this post Link to post Share on other sites More sharing options...
Moutaz Bahig Posted November 11, 2014 Report post Posted November 11, 2014 I know it is old topic, I have below patch that always fail in deployment using SCCM 2007 file forfiles.exe -p %appdata%\Microsoft\Signatures\ -m *.* -d -30 -c "cmd /c del /q @path" error as below A failure exit code of 1 was returned. User context: NT AUTHORITY\SYSTEM Possible cause: Systems Management Server (SMS) determines status for each program it executes. If SMS cannot find or correlate any installation status Management Information Format (MIF) files for the program, it uses the program's exit code to determine status. An exit code of 1 is considered a failure. Solution: For more information on the exit code, refer to the documentation for the program you are distributing any suggestion. Thank you Quote Share this post Link to post Share on other sites More sharing options...