shell vb6 命令 重命名,如何在不打开VB6一个CMD窗口中运行shell命令

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值