- Joined
- Aug 16, 2005
- Messages
- 25,772 (3.79/day)
- Location
- Alabama
System Name | Rocinante |
---|---|
Processor | I9 14900KS |
Motherboard | EVGA z690 Dark KINGPIN (modded BIOS) |
Cooling | EK-AIO Elite 360 D-RGB |
Memory | 64GB Gskill Trident Z5 DDR5 6000 @6400 |
Video Card(s) | MSI SUPRIM Liquid X 4090 |
Storage | 1x 500GB 980 Pro | 1x 1TB 980 Pro | 1x 8TB Corsair MP400 |
Display(s) | Odyssey OLED G9 G95SC |
Case | Lian Li o11 Evo Dynamic White |
Audio Device(s) | Moondrop S8's on Schiit Hel 2e |
Power Supply | Bequiet! Power Pro 12 1500w |
Mouse | Lamzu Atlantis mini (White) |
Keyboard | Monsgeek M3 Lavender, Akko Crystal Blues |
VR HMD | Quest 3 |
Software | Windows 11 |
Benchmark Scores | I dont have time for that. |
Hey guys I need to modify this script to append a file name instead of rewrighting it. I dont really know anything about VBS unfortunately and I can see where it is saying to over wright. but im unsure how to proceed.
Can anyone help me out? Basically I have this script working as it should. I need to pull this file and dump it on a network folder so we can monitor that a specific program version is being used. however I need it to append so that I can make sure when an update hits that its being updated. I have multiple PCs dumping this file. Maybe VBS can pull a computer name and append that instead?
Code:
' ' VBScript
Option explicit
' Next line is important, as it calls our function:
Wscript.Echo CopyAFile( "c:\HORWA05DS\PC\Installation", "\\10.204.103.19\version", "pc_release_id.txt")
' Next three lines illustrate correspondence of data to arguments:
''' strSourceFolder := "c:\HORWA05DS\PC\Installation"
''' strTargetFolder := "\\10.204.103.19\version"
''' strFileName := "pc_release_id.txt"
'
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,[COLOR="Red"] booOverWrite[/COLOR], 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
[COLOR="red"]If objFSO.FileExists( strTargetFolder & "\" & strFileName) Then
strResult = "The file exists, overwritten"
booOverWrite = vbTrue[/COLOR]
Else
strResult = "The file does not exist, created"
booOverWrite = vbFalse
End If
objFSO.CopyFile strSourceFolder & "\" & strFileName, strTargetFolder & "\", [COLOR="red"]booOverWrite[/COLOR]
Else
strResult = "The source file does not exist, or identical Source and Target folders!"
End If
CopyAFile = strResult
End Function
Can anyone help me out? Basically I have this script working as it should. I need to pull this file and dump it on a network folder so we can monitor that a specific program version is being used. however I need it to append so that I can make sure when an update hits that its being updated. I have multiple PCs dumping this file. Maybe VBS can pull a computer name and append that instead?