RunProgram を使用して cmd.exe を起動し、コマンドを実行するRunProgram を使用して、cmd.exe を介して notepad.exe などの実行可能ファイルを実行したいと考えています。
以下は正しいディレクトリを返しますが、オプションリスト「notepad.exe」に別のコマンドを追加すると、システムが指定されたパスを見つけることができないというエラーが表示されます。
cmd1 = "/k cd /d " || "C:\Windows\System32";
RP = RunProgram(
Executable( "CMD.EXE"),
Options( {cmd1} ),
ReadFunction("text")
);私もこのエラーを数回見ましたが、それが何を言っているのか完全には理解していません。 これはどのように修正できますか?
The external program was producing output when the RunProgram object was destroyed.
Use a JSL variable to hold the RunProgram object.
Optionally, send messages to the variable to manage the object's lifetime.
Re: RunProgram を使用して cmd.exe を起動し、コマンドを実行する完璧です、ありがとう。複数の例のドロップダウン リストに気付いたことがないなんて信じられません。
Re: RunProgram を使用して cmd.exe を起動し、コマンドを実行する[ヘルプ] > [スクリプト インデックス] > [関数] > [プログラムの実行] の例 3 を参照してください。
第9章のために書かれたスクリプトが添付されていますJSL Companion、JMP スクリプト言語のアプリケーション、第 2 版.複数のコマンドを読み取るための複数の方法が含まれています。 1 つのプログラムに対する複数のコマンド、または複数の DOS コマンド。複数の dos コマンド (cd、dir など) については、このスクリプトの例 #5 を参照してください。ディスカッション ノートは 199 行目から始まり、JSL は 253 ~ 287 行目にあります。
セッション中にメモを取るだけの場合は、プログラムの実行を必要としない簡単なスクリプトを次に示します。
Names Default to Here(1);
noteslst ={};
InsertInto(noteslst, char(AsDate(Today()))|| " Notes");
InsertInto(noteslst, "Hello, World!");
InsertInto(noteslst,"It's hot here, 99 degrees");
InsertInto(noteslst,"Time to cool off");
InsertInto(noteslst,"Good Bye");
xtxt = Concat Items(noteslst,"\!N");
Save Text File( "c:\temp\July23Notes.txt" , xtxt);