2017-08-13 20 views
0

コマンドプロンプトで実行される.exeがあり、文字を押してタスクを実行するよう求められます。 .exeファイルを実行し、yを押してアクションを実行するバッチファイルが必要です。これはこれまで私が持っているものです:バッチファイルを使用してコマンドを入力して、コマンドを入力してください。

start cmd.exe /k ""C:\Users\mayes\Documents\Utilities\Macros\Second Keyboard Macros\Intercept\intercept\intercept.exe"" 

すべてのことは.exeファイルを開きます。私もyを押す必要があります。私は、バッチファイルがやりたいことの

デモンストレーション:

https://media.giphy.com/media/Ujsia9OeUqJuo/giphy.gif

+0

開始cmd.exe/k "C:¥Users¥mayes¥Documents¥Utilities¥Macros¥Second Keyboard Macros¥Intercept¥intercept¥intercept.exe"/Q –

+0

/Qは、自動モードを意味します。 –

+2

これは、intercept.exeにコマンドラインオプションがあるかどうかによって異なります。あなたは 'echo y |" C:\ Users \ mayes \ Documents \ Utilities \ Macros \ Second Keyboard Macros \ Intercept \ intercept \ intercept.exe "と言うことができるでしょう。"私は答えとしてそれを投稿するのには自信がありません。 – SomethingDark

答えて

0

だから、別のもっと簡単な方法があり、プログラムは引数に建てられた、

C:\Stack\intercept>intercept.exe /help 

*** Keyboard Remapper v. 1 
*** Based on Oblitum Interception http://oblita.com/Interception.html 

Use /help for help on command-line options 

Command line parameters: 
     /ini path  oile.ini specify alternate config file (optional) 
     /apply    non-interactive, apply filters on startup (optional) 

C:\Stack\intercept> 

はこれだけ/applyでショートカットを作ると、あなたはGOLDENです!/helpと入力すると、組み込みの引数とオプションのコンソールアプリケーションをチェックするのに便利なヒントです。

0

あなたはVBスクリプトの魔女でキーを送信することができますが、バッチから実行することができます。 .vbsとして保存

set shell = CreateObject("WScript.Shell") 
shell.run"C:\Users\mayes\Documents\Utilities\Macros\Second Keyboard Macros\Intercept\intercept\intercept.exe" 
WScript.Sleep 1500 
shell.SendKeys"{Y}" 
shell.SendKeys"{ENTER}" 

、そしてそれはあなたが使用することができますバッチから、それを実行したい: これを試してみてください

cscipt "nameoffile".vbs

はそれがあなたのために働く願っています!あなたが/helpを入力した場合

+0

.vbsファイルを実行すると、実行するプログラムがわかります。 [link](https://i.imgur.com/vGbUe0L.jpg) –

+0

oddがアイコンで、スクリプトファイルのファイルタイプが「vbスクリプト」に変更されていますか? cmdから 'cscript" filename ".vbs'でスクリプトを実行してみてください。 – TerraBys

関連する問題