VBSCRIPT无法使用参数运行程序而不是隐藏

时间:2017-08-05 22:53:58

标签: batch-file vbscript

我有一个批处理脚本正在运行以下程序,但决定更改它,因为应用程序的窗口没有隐藏,并且在屏幕上的任何地方都闪烁。我决定使用VBScript,但我现在正在努力在运行应用程序的VBScript上实现相同的功能,使用与批处理文件相同的参数。我最初使用VBScript运行没有参数的程序,它打开程序但不隐藏它。我需要的两件事。

  1. 如何使用参数运行程序并隐藏它。

  2. 如果循环也可以使用参数实现

          :: Innitial working batch script :
    
          FOR /L %%i IN (1,1,114) DO (
            rem  ECHO %%i
    
          "C:\Program Files (x86)\Example Heli\HFDM Converter\HFDM_CONVERTER.EXE" "C:\HFDM_converter\Arinc 717 Description\H175_STEP2+_FDCR_converter_configuration_file_v4.xml" "C:\HFDM_converter\Gilda Directory\H175_V5.1R6.0_GILDA_V2501_FDCR_converter_delivery" "C:\Program Files (x86)\Example Heli\Process_fdc" "C:\archive" %%i pcm /ae  /s /hp /ss /sn
    
          )
    
  3. ::VB Script to help with ::
    
    Dim objShell
    Set objShell=WScript.CreateObject("WScript.Shell")
    
    
    a= ""C:\Program Files (x86)\Example Heli\HFDM Converter\HFDM_CONVERTER.EXE""
    b= ""C:\HFDM_converter\Arinc 717 Description\H175_STEP2+_FDCR_converter_configuration_file_v4.xml""
    c= ""C:\HFDM_converter\Gilda Directory\H175_V5.1R6.0_GILDA_V2501_FDCR_converter_delivery""
    d= ""C:\Program Files (x86)\Example Heli\Process_fdc""
    e= ""C:\archive""
    
    objShell.Run """C:\Program Files (x86)\Example Heli\HFDM Converter\HFDM_CONVERTER.EXE"" b c d e 004 pcm /ae  /s /hp /ss /sn", 0, false
    

1 个答案:

答案 0 :(得分:0)

我决定选择autoit。这是代码:谢谢

Local $i
sleep(2000)

For $i = 1 To 300 Step 1
    sleep(100)

    ;;; MsgBox($MB_SYSTEMMODAL, "", "Count down!" & @CRLF & $i)
RunWait('"C:\Program Files (x86)\Examples Heli\HFDM Converter\HFDM_CONVERTER.EXE" "C:\Program Files (x86)\AIRBUS HELICOPTERS\HFDM Converter\Arinc 717 Description\H175_STEP2+_FDCR_converter_configuration_file_v4.xml" "C:\Program Files (x86)\Examples heliHFDM Converter\Gilda Directory\H175_V5.1R6.0_GILDA_V2501_FDCR_converter_delivery" "C:\Program Files\WinSCP\Unconverted" "C:\FDM\Upload" ' & $i  & ' pcm /ae /s ' )

sleep(50000) ;;;; very important because if many fcd in a folder, the hfdm converter might close to move to the next fcd and you do not want to jump the loop quickly
Next