Re: Copy folder to a remoted Computer then run executeable



Hi Pete,

Thanks so very much for your reply. I'll been struggling quite a bit with
this being fairly new to this scripting language.

After thinking about it, you ended up integrating the methodology that I
thought might accomplish the task. I have to take some time looking through
this to see if it will copy the folder from a server share to the desktop of
the remote workstation and then execute the batch file. Looks like it will
work. I'll let you know.
--
Thank you very much again,
Chris A. Zanowick


"Pete" wrote:

> I used the following to deploy service packs to win 2000 machines, it worked
> ok but doesn't return satisfactory error codes for the installation - ie
> 3010 - reboot required. It only returns a code for whether the command was
> sent ok. I resorted to using a modified version with psexec which gave
> accurate reporting.
>
> Pete
>
> strcomputer = InputBox("Enter the name of the Computer you wish to update."
> & VbCrLf &_
> VbCrLf & "Click OK, then select the file you wish to install.","Service
> Pack Installer")
>
> Set objDialog = CreateObject("UserAccounts.CommonDialog")
> objDialog.Filter = "All Files|*.*"
> objDialog.InitialDir = "C:\"
> intresult = objDialog.ShowOpen
> strSP = objDialog.FileName
>
> strSwitches = inputbox("Add any switches required", "Install Switches",
> " -N -O -Z -Q")
>
>
>
> Dim fso, oFile
> Set fso = CreateObject("Scripting.FileSystemObject")
>
> Set oFile = fso.CreateTextFile("c:\install.cmd", True)
> oFile.WriteLine(strSP & " " & strswitches)
> oFile.Close
>
> Set oFile = fso.CreateTextFile("c:\copyfiles.cmd", True)
> oFile.WriteLine("COPY " & strSP & " \\" & strcomputer & "\c$")
> oFile.WriteLine("COPY c:\install.cmd \\" & strcomputer & "\c$")
> oFile.Close
>
>
>
> Dim oShell
> Set oShell = WScript.CreateObject("WScript.Shell")
> copyreturn = oShell.Run("c:\copyfiles.cmd", 0, True)
>
> If copyresult = 0 Then
>
> Set process = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
> strcomputer & "\root\cimv2:Win32_Process")
> installreturn = process.Create("c:\install.cmd",Null,Null,processid)
> If installreturn = 0 Then
> If MsgBox("The install has started successfully." & vbcrlf & vbcrlf &_
> "Do you want to view the log file?", vbyesno + vbquestion,
> "Installation on: " & ucase(strcomputer)) = vbyes then
> Set oShell = CreateObject("WScript.Shell")
> Call oShell.Run("cmd /c \\" & strcomputer &
> "\c$\winnt\svcpack.log",0,True)
> End If
> Else
> If MsgBox("The install command failed to start." & vbcrlf & vbcrlf &_
> "Do you want to view the log file?", vbyesno + vbquestion,
> "Installation on: " & ucase(strcomputer)) = vbyes then
> wscript.sleep 150000
> Set oShell = CreateObject("WScript.Shell")
> Call oShell.Run("cmd /c \\" & strcomputer &
> "\c$\winnt\svcpack.log",0,True)
> End If
> End If
>
> Else
> wscript.echo strcomputer & "File Copy Failed"
> End If
>
>
>
> "Chris A. Zanowick" <chris_zanowick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> message news:0BE8DBB1-7068-4FA6-BA15-7647C512D6DC@xxxxxxxxxxxxxxxx
> > Hi Everyone,
> >
> > Has anyone out there attempted to write a WSH script to do the following?
> >
> > Display an input box to enter a remote computer in a domain on which to
> > run
> > the script remotely.
> >
> > Then copy a folder and it's contents from "\\server\installs\NAV" to the
> > remote computer's "c:\documents and settings\userprofile\desktop"
> > directory.
> >
> > Then I want to run the batch file in the NAV folder after the copying?
> > --
> > Thank you,
> > Chris A. Zanowick
>
>
>
.



Relevant Pages

  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... This remote server was built using connect computer script, ...
    (microsoft.public.windows.server.sbs)
  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... This remote server was built using connect computer script, ...
    (microsoft.public.windows.server.sbs)
  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... is a GC/AD server with DNS and DHCP for it's area. ...
    (microsoft.public.windows.server.sbs)
  • Re: wshremote not running script on remote computer
    ... "The script you deploy to the remote computer must not attempt to interact ... I do want to open a command window on a remote machine, ...
    (microsoft.public.scripting.vbscript)
  • Re: Cant get something basic to work (WMI)
    ... This has nothing to do with DCOM, but with the security packages in the SSPI ... in many well administered networks. ... The process created by WIn32_Process.Create on the remote machine ... Use of any included script samples are subject to the terms specified at ...
    (microsoft.public.windowsxp.wmi)