Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Local Files to Remote Path

Status
Not open for further replies.

michcarr

MIS
May 11, 2004
9
US
Hello There, I am a Very green VBScript NewBee.. I am trying to figure out how to take the following batch file and make it into a VBScript, and for the life of me I am unable to figure it out. If anyone could help me out it would be appreciated.

@echo off

set /p computername=Please enter the Computer Name or IP

set /p username=Please Enter the Users Login ID


Copy "\\servername\path\servers.lst" "\\%computername%\c$\Documents and Settings\%username%\Local Settings\Application Data\servers\Temp\"

Copy "\\servername\path\servers.lst" "\\%computername%\c$\Program Files\servers\Temp"

Any help you could offer would be appreciated.

Thank You in Advance,
MC
 
Not tested, but this should get you started:
Code:
Option Explicit
Dim sComputer, sUsername
sComputer = InputBox("Please enter the Computer Name or IP")
sUsername = InputBox("Please Enter the Users Login ID")

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "\\servername\path\servers.lst", "\\" & sComputer & "\c$\Documents and Settings\" & sUsername & "\Local Settings\Application Data\servers\Temp\"
fso.CopyFile "\\servername\path\servers.lst", "\\" & sComputer & "\c$\Program Files\servers\Temp"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top