goldstem
Technical User
- May 21, 2009
- 10
Hello everyone,
The extent of my VB Script knowledge is enough to butcher other people(s') scripts for my own use, and they're probably inefficient, but have worked.
Scenario -
300 workstations need a perconfigured ini file
*Here's the catch*
Each workstation has it's own INI file.
This is what I have as far as trying to get a script to work -
Dim objShell, strComputer, strInput
Dim objFSO
Do
strComputer = (InputBox(" ComputerName to Copy File", "Computer Name"))
If strComputer <> "" Then
strInput = True
End if
Set oShell = CreateObject( "WScript.Shell" )
strcomputer=oShell.ExpandEnvironmentStrings("%Computername%")
set objFSO=CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder "\\hq-filestore\apps\storeforward\_branches\workstations\%computername%\*", "\\%computername%\C$\Program Files\PowerTerm\"
objFSO.CopyFile "\\hq-filestore\apps\storeforward\_branches\workstations\%computername%\ptcomm.ini", "\\%computername%\C$\Program Files\PowerTerm\"
End If
Wscript.Quit
The goal and function of this script is to have an input box to open and the user types in the workstation name to resolve the variable %computername%.
I've created several workstation folders so all the names will correspond with eachother.
And please, no suggestions of 3rd party apps, we have reason why we're going the script route.
Thank you in advance!
The extent of my VB Script knowledge is enough to butcher other people(s') scripts for my own use, and they're probably inefficient, but have worked.
Scenario -
300 workstations need a perconfigured ini file
*Here's the catch*
Each workstation has it's own INI file.
This is what I have as far as trying to get a script to work -
Dim objShell, strComputer, strInput
Dim objFSO
Do
strComputer = (InputBox(" ComputerName to Copy File", "Computer Name"))
If strComputer <> "" Then
strInput = True
End if
Set oShell = CreateObject( "WScript.Shell" )
strcomputer=oShell.ExpandEnvironmentStrings("%Computername%")
set objFSO=CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder "\\hq-filestore\apps\storeforward\_branches\workstations\%computername%\*", "\\%computername%\C$\Program Files\PowerTerm\"
objFSO.CopyFile "\\hq-filestore\apps\storeforward\_branches\workstations\%computername%\ptcomm.ini", "\\%computername%\C$\Program Files\PowerTerm\"
End If
Wscript.Quit
The goal and function of this script is to have an input box to open and the user types in the workstation name to resolve the variable %computername%.
I've created several workstation folders so all the names will correspond with eachother.
And please, no suggestions of 3rd party apps, we have reason why we're going the script route.
Thank you in advance!