VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 自动更新工作站的应用程序
发表评论(0)作者:, 平台:, 阅读:9611, 日期:2000-03-12
Private Sub Form_Load()

On Error GoTo errorhandler

' Command 函数返回

' 命令行的字符串信息

' 该程序需要两个参数

' 如:(thisprog.exe c:\localdir\prgcopied.exe

' k:\servrdir\prgtocopy.exe)

If FileDateTime(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

FileCopy Mid$(Command$, _

InStr(Command$, " ") + 1), _

Left(Command$, InStr(Command$, " ") - 1)

End If

'开始程序

x = Shell(Left(Command$, InStr(Command$, " ") - 1), 3)

End

Exit Sub

errorhandler:

If Err = 53 Then '文件没有

Resume Next '还是要拷贝

Else

MsgBox "错误 # " & Err & Chr(10) & Error _

& Chr(10) & "结束"

End

End If

Exit Sub

End Sub