Shell commands in VB

前端 未结 3 1238
伪装坚强ぢ
伪装坚强ぢ 2021-01-23 05:15

For some reason it seems that ampersands are not working like they should when I attempt to use them in shell commands in VB. When I attempt to link two commands together on the

3条回答
  •  时光说笑
    2021-01-23 05:44

    Have you considered using the Process object to start ADB with the CommandLine options being set

    Dim psi As New ProcessStartInfo
    
    psi.WorkingDirectory = "c:\"
    psi.Arguments = "shell monkey -p com.android.system -v 1"
    psi.FileName = "ADB"
    psi.WindowStyle = ProcessWindowStyle.Hidden
    return Process.Start(psi)
    

    in the event that your ADB program only allows a single instance to run, maybe you need to add the following

    Dim ps As Process = Process.Start(psi)
    ps.WaitForExit()
    
    psi.Arguments = 'new arguments
    Process.Start(psi)
    

提交回复
热议问题