can anyone advise of any issues with deploying scripts through sccm

i have tried both of the below commands

one copies a vb script locallyt and tries to run it, this doesnt work despite copying it

the other is a straight run command which also doesnt work?

"%~dp0setup_vmb.exe" /s /v/qn


attrib "c:\users\public\desktop\Vodafone Mobile Broadband.lnk" -r -h -s -a

del "c:\users\public\desktop\Vodafone Mobile Broadband.lnk" /f /q

attrib "c:\users\default\desktop\Vodafone Mobile Broadband.lnk" -r -h -s -a

del "c:\users\default\desktop\Vodafone Mobile Broadband.lnk" /f /q




"%~dp0setup_vmb.exe" /s /v/qn


xcopy.exe ""%~dp0RemoveDesktopIcon.vbs" "C:\ProgramData\SRFT\Vodafone3GIconRemoval\" /y /e /s /i


cscript.exe "C:\ProgramData\SRFT\Vodafone3GIconRemoval\RemoveDesktopIcon.vbs"


any suggestions would be welcome!




0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



the first one you only neeed to delete it from public's desktop, may also be "public desktop"

attrib "c:\users\public\public desktop\Vodafone Mobile Broadband.lnk" -r -h -s -a

del "c:\users\public\public desktop\Vodafone Mobile Broadband.lnk" /f /q

#2 try putting a start /wait in front of your commands

start /wait xcopy.exe ""%~dp0RemoveDesktopIcon.vbs" "C:\ProgramData\SRFT\Vodafone3GIconRemoval\" /y /e /s /i


start /wait cscript.exe "C:\ProgramData\SRFT\Vodafone3GIconRemoval\RemoveDesktopIcon.vbs"

Answered 10/16/2012 by: SMal.tmcc
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity



hi thanks for this, before i try this what would this achieve?



Answered 10/16/2012 by: keane2012
Brown Belt

  • the start /wait forces the xcopy to finish prior to the cscript executing, I have had the copy take long enough that the command to call it already scripted by
Please log in to comment

Keep in mind that SCCM operates in the system space, not the user space.  So if your script deletes icons from the current user desktop, it will - from the system account's desktop.   also, do you get errors?  Or does the script not provide any kind of progress message or status logging?  My employer uses a wrapper for their SCCM installs and one component of that wrapper is a logging function that logs the commands being run and their return code - it's a big wrapper, but those logs are incredibly valuable in troubleshooting why something doesn't run the way we want it to.

Answered 10/16/2012 by: Arminius
Second Degree Green Belt

  • it doent produce any errors, it just doesnt finish
    i have checked the logs
    it just doesnt run through sccm
Please log in to comment

The command line you're running tells me that the installer is extracting an MSI and launching it. The /v switch tells the installer you're running to pass anything after it to msiexec.

Grab the MSI and any related files from %temp% when you launch the setup executable, or use your favourite zip program to attempt to extract the installer from the setup executable.

Use your packaging tool to create an MST remove the offending shortcut and deploy as you would any other MSI/MST combination.

No need for scripts and a nicer, more appropriate method of achieving your aim.



Answered 10/17/2012 by: dunnpy
Red Belt

Please log in to comment