Created
August 2, 2012 14:48
-
-
Save bouzuya/3237589 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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