Prev: are VBscript on Windows server 2003 and VBscript on WS2008 compatible?
Next: vbs with conditions
From: Kash on 26 Apr 2010 06:21 Hi All, I want to install a software on remote pc by copying .exe file to the remote pc & then want to install it on remote pc. i'm bit confused how to do that... Can someone Help me out.. Just started playing with VB script and I'm trying the below script. Regards, Kash Option Explicit ON Error Resume NEXT Dim FSO, wshnetwork, strcomputer, shell, return const overwriteexisting = true Set FSO = Createobject("Scripting.FileSystemObject") Set WSHNetwork = Createobject("Wscript.Network") set shell = wscript.createobject("wscript.shell") strcomputer = inputbox("Please enter the computername: ") fso.copyfile "\\tpsys\tpsoftware$\BatchFile\Softwares\Adobe9.exe", "\\" & strcomputer & "\c$\Windows\Temp\", overwriteexisting set objsoftware = "\\" & strcomputer & "\c$\Windows\Temp\Adobe9.exe" return = objsoftware.install("\\" & strcomputer & "\c$\Windows\Temp\Adobe9.exe",,True)
From: Al Dunbar on 26 Apr 2010 12:56 "Kash" <Kash(a)discussions.microsoft.com> wrote in message news:314703D9-18D8-4D8F-A39B-6191D6B605B7(a)microsoft.com... > Hi All, I want to install a software on remote pc by copying .exe file to > the > remote pc & then want to install it on remote pc. i'm bit confused how to > do > that... > Can someone Help me out.. > Just started playing with VB script and I'm trying the below script. > Regards, > Kash > > > Option Explicit > ON Error Resume NEXT > Dim FSO, wshnetwork, strcomputer, shell, return > const overwriteexisting = true > Set FSO = Createobject("Scripting.FileSystemObject") > Set WSHNetwork = Createobject("Wscript.Network") > set shell = wscript.createobject("wscript.shell") > strcomputer = inputbox("Please enter the computername: ") > fso.copyfile "\\tpsys\tpsoftware$\BatchFile\Softwares\Adobe9.exe", "\\" & > strcomputer & "\c$\Windows\Temp\", overwriteexisting > set objsoftware = "\\" & strcomputer & "\c$\Windows\Temp\Adobe9.exe" > return = objsoftware.install("\\" & strcomputer & > "\c$\Windows\Temp\Adobe9.exe",,True) I am not familiar with any COM object having a .install method, however, the last set command above seems likely to fail. The set command assigns an object value to a variable, however, you have attempted to assign a string value. The most common usage of the set command is to assign the variable a value supplied by the CreateObject or GetObject functions, each of which accepts the "ProgID" of an installed COM object, for example "scripting.filesystemobject", "Excel.Application", "ADSystemInfo". If the COM object you are wanting to use has a known ProgID, you might be able to instantiate it on the remote system with something like: set objsoftware = createobject("whatever.ProgID", strComputer ) Alternately, COM objects can be defined by giving a path to them instead of their registered ProgID. Unfortunately, I am pretty rusty on this stuff at present... /Al
|
Pages: 1 Prev: are VBscript on Windows server 2003 and VBscript on WS2008 compatible? Next: vbs with conditions |