PrivateSubForm_Load()
OnErrorGoToerrorhandler
'Command函數返回
'命令行的字符串信息
'該程序需要兩個參數
'如:(thisprog.exec:localdirprgcopied.exe
'k:servrdirprgtocopy.exe)
IfFileDateTime(Left(Command$,InStr(Command$,"")-1))<FileDateTime(Mid$(Command$,InStr(Command$,"") 1))Then
Top=(Screen.Height-Height)/2
Left=(Screen.Width-Width)/2
label1="拷貝"&Mid$(Command$,InStr(Command$,"") 1)&"到你的硬盤..."
Visible=True
Refresh
FileCopyMid$(Command$,InStr(Command$,"") 1),Left(Command$,InStr(Command$,"")-1)
EndIf
'開始程序
x=Shell(Left(Command$,InStr(Command$,"")-1),3)
End
ExitSub
errorhandler:
IfErr=53Then'文件沒有
ResumeNext'還是要拷貝
Else
MsgBox"錯誤#"&Err&Chr(10)&Error&Chr(10)&"結束"
End
EndIf
ExitSub
EndSub->