Skip to content

Instantly share code, notes, and snippets.

@bouzuya
Created August 2, 2012 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bouzuya/3237589 to your computer and use it in GitHub Desktop.
Save bouzuya/3237589 to your computer and use it in GitHub Desktop.
Option Explicit
Private Sub Copy(ByVal strSrc, ByVal strDst)
Dim objFso
Set objFso = WScript.CreateObject("Scripting.FileSystemObject")
If objFso.FileExists(strSrc) Then
Call objFso.CopyFile(strSrc, strDst)
Else
' do nothing
End If
End Sub
Private Function Main()
If Not ValidateArguments() Then
Main = 1
Exit Function
End If
Dim strSrcFile, strDstDir
strSrcFile = WScript.Arguments.Named.Item("srcfile")
strDstDir = WScript.Arguments.Named.Item("dstdir")
Dim strDate
strDate = FormatDate(Date())
WScript.Echo("strDate: " & strDate)
WScript.Echo()
WScript.Echo("Hello, WSH!")
WScript.Echo()
WScript.Echo("srcfile:" & strSrcFile)
WScript.Echo("dstdir :" & strDstDir)
WScript.Echo()
Call Copy(strSrcFile, strDstDir)
Main = 0
End Function
WScript.Quit(Main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment