/build/static/layout/Breadcrumb_cap_w.png

Problem deploying a vbs or bat file through sccm, works fine manually

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!

thanks

 

 


0 Comments   [ + ] Show comments

Answers (4)

Posted by: SMal.tmcc 12 years ago
Red Belt
1

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"

Posted by: keane2012 12 years ago
Brown Belt
0

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

thanks

 


Comments:
  • 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 - SMal.tmcc 12 years ago
Posted by: Arminius 12 years ago
Second Degree Green Belt
0

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.


Comments:
  • it doent produce any errors, it just doesnt finish
    i have checked the logs
    it just doesnt run through sccm - keane2012 12 years ago
Posted by: dunnpy 12 years ago
Red Belt
0

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.


Thanks,

Dunnpy

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ