【发布时间】:2012-01-04 23:12:52
【问题描述】:
以下代码来自我的 VB6 程序
我在 VB 中使用 shell 命令来执行带有标志和参数的 pscp.exe
我的问题是,当 VB 运行时:
Shell strCommand, 1
它还会打开 CMD 窗口 2-4 秒(CMD 弹出窗口)
我的问题 - 是否可以以不会打开 CMD 窗口的方式运行“Shell strCommand, 1”?
我的意思是 - 我不想在运行 VB 应用程序时看到任何 CMD 弹出窗口
Const cstrSftp As String = "D:\pscp.exe"
Dim strCommand As String
Dim pUser As String
Dim pPass As String
Dim pHost As String
Dim pFile As String
Dim pRemotePath As String
pUser = "root"
pPass = "pass123"
pHost = "110.218.201.15"
pFile = """D:\scan_ip.ksh"""
pRemotePath = "/var/tmp"
strCommand = cstrSftp & " -sftp -l " & pUser & " -pw " & pPass & " " & pHost & ":" & pRemotePath & " " & pFile
Shell strCommand, 1
【问题讨论】:
-
通过不明确告诉它显示:)
标签: windows vba vb6 batch-file