the following code is part from my VB6 program
I used shell command in the VB in order to execute the pscp.exe with the flags and arguments
my problem is , when VB run the line:
Shell strCommand, 1
its also open the CMD window for 2-4 seconds (CMD popup window)
my question - is it possible to run the "Shell strCommand, 1" in way that CMD window will not opened?
I mean - I not want to see any CMD popup window when I run VB application
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
解决方案
You can use hidden focus:
Shell strCommand, vbHide
or
Shell strCommand, 0