Answered by:
how to push VBScript through sms 2003

Question
-
how can i push vbscript to all my Windows Xp Client Computers.
say I have shared folder Apps which contain vbscript say test.vbs i want to push this to all my Windows Xp computers.
what would be the command line to run this script silently.
Sunday, February 19, 2012 4:05 PM
Answers
-
create an empty package and a program with a commandline like this cscript.exe vbscript.vbs and configure C:\Apps\ as the directory.
Kent Agerlund | My blogs: blog.coretech.dk/kea and SCUG.dk/ | Twitter: @Agerlund | Linkedin: Kent Agerlund
- Proposed as answer by Garth JonesMVP Sunday, March 18, 2012 4:53 PM
- Marked as answer by Garth JonesMVP Monday, December 22, 2014 3:04 AM
Sunday, February 19, 2012 5:01 PM -
Stupid question but why store the DLL on a server? Why not use SMS2k3 to deliver the DLL to the WS installed?
i.e. have you program do something like this.
Copy abc.dll c:\Program Files\Software\abc.dll
http://www.enhansoft.com/
- Proposed as answer by Garth JonesMVP Sunday, March 18, 2012 4:53 PM
- Marked as answer by Garth JonesMVP Monday, December 22, 2014 3:04 AM
Monday, February 20, 2012 10:02 PM
All replies
-
create an empty package and a program with a commandline like this cscript.exe vbscript.vbs and configure C:\Apps\ as the directory.
Kent Agerlund | My blogs: blog.coretech.dk/kea and SCUG.dk/ | Twitter: @Agerlund | Linkedin: Kent Agerlund
- Proposed as answer by Garth JonesMVP Sunday, March 18, 2012 4:53 PM
- Marked as answer by Garth JonesMVP Monday, December 22, 2014 3:04 AM
Sunday, February 19, 2012 5:01 PM -
I want to copy a dll file on windows xp computers on my network.
i have shared a folder on one server say \\server1\sharedfolder\abc.dll.
I want to overwrite this abc.dll file on to C:\program files\software\abc.dll on to all my windows xp computers.
i have written a vbscript and it is 100 percent working fine in a hidden way.it is working manually but when i send through sms
it is failing. the script seems to be executing but the file is not being copied and i could not notice any error.
i have created a shared folder where i put this vbscript and created empty packge and program.
i have given command line: testscript.vbs it is not working
i also gave at command line :"C:\windows\system32\cscript.exe" testscript.vbs it is not working.
please guide me
- Edited by Risingflight Monday, February 20, 2012 6:49 AM naming error
Monday, February 20, 2012 6:48 AM -
what is the command used in the testscript.vbs ? Is it blank?
Anoop C Nair - @anoopmannur
MY BLOG: http://anoopmannur.wordpress.com
User Group: ConfigMgr Professionals
This posting is provided AS-IS with no warranties/guarantees and confers no rights.
Monday, February 20, 2012 7:21 AM -
The below script is what i am executing to copy a dll file on to all my Windows Xp Computers. During the package creation i have given run with admin privileges.
On server1 i have shared a folder which contains my dll file(xyz.dll).For testing purpose i gave full permission in sharing and security for Domain users and doman Computers.
The name of this script lets say testvbs, wht should i give the command line. There is no issue with the script i belive
' ' VBScript
Option explicit
' Next line is important, as it calls our function:
'Wscript.Echo CopyAFile( "\\Server1\SharedFolder", "c:\Program Files\Software", "abc.dll")
Dim strMsg
strMsg = CopyAFile( "\\Server1\SharedFolder", "c:\Program Files\Software", "abc.dll")
' Next three lines illustrate correspondence of data to arguments:
''' strSourceFolder := "\\Server1\SharedFolder"
''' strTargetFolder := "c:\Program Files\Software"
''' strFileName := "abc.dll"
'
Wscript.Quit
Function CopyAFile( Byval strSourceFolder, Byval strTargetFolder, Byval strFileName)
'
' Presumptions:
' strSourceFolder folder must exist
' strTargetFolder folder must exist
' strFileName file must exist in strSourceFolder folder
'
Dim objFSO, booOverWrite, strResult
Set objFSO = CreateObject( "Scripting.FileSystemObject")
If objFSO.FileExists( strSourceFolder & "\" & strFileName) _
And UCase( strSourceFolder) <> UCase( strTargetFolder) Then
If objFSO.FolderExists( strTargetFolder) Then
Else
strResult = "The destination folder does not exist! In general, creating a folder may be a non-trivial task."
CopyAFile = strResult
Exit Function
End If
If objFSO.FileExists( strTargetFolder & "\" & strFileName) Then
strResult = "The file exists, overwritten"
booOverWrite = vbTrue
Else
strResult = "The file does not exist, created"
booOverWrite = vbFalse
End If
objFSO.CopyFile strSourceFolder & "\" & strFileName, strTargetFolder & "\", booOverWrite
Else
strResult = "The source file does not exist, or identical Source and Target folders!"
End If
CopyAFile = strResult
End Function
Monday, February 20, 2012 7:59 AM -
May be you can get more details about current directory settings while running the programs from SMS or configmgr
Anoop C Nair - @anoopmannur
MY BLOG: http://anoopmannur.wordpress.com
User Group: ConfigMgr Professionals
This posting is provided AS-IS with no warranties/guarantees and confers no rights.
Monday, February 20, 2012 9:24 AM -
Hello
Thanks alot but i am confused still. Adding the below lines to the script, will it work and wht should i put in the command line
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WshShell = WScript.CreateObject("WScript.Shell")info = WshNetwork.UserDomain & "\" & WshNetwork.UserName & vbCrLf & WshShell.CurrentDirectory
WScript.Echo info
Monday, February 20, 2012 7:02 PM -
if possible can you add lines to this scriptMonday, February 20, 2012 7:04 PM
-
Stupid question but why store the DLL on a server? Why not use SMS2k3 to deliver the DLL to the WS installed?
i.e. have you program do something like this.
Copy abc.dll c:\Program Files\Software\abc.dll
http://www.enhansoft.com/
- Proposed as answer by Garth JonesMVP Sunday, March 18, 2012 4:53 PM
- Marked as answer by Garth JonesMVP Monday, December 22, 2014 3:04 AM
Monday, February 20, 2012 10:02 PM