-1
자바 스크립트를 사용하여 notepad.exe
을 시작하고 다음 스크립트를 사용하여 매개 변수를 전달합니다. 그것은 notepad.exe
를 시작하지만 Hello World.txt does not exists. Do you want to create?
자바 스크립트를 사용하여 notepad.exe에 매개 변수를 전달하지 못했습니다.
모든 아이디어/제안이 매개 변수를 전달하고 notepad.exe
이 notepad.exe
의 명령 줄 인수가 열 수있는 파일 이름, 메모장이 아닌 초기 내용입니다 Hello World
function passParam()
{
try{
//get brwosers details
var isIE = /*@[email protected]*/false || !!document.documentMode;
if(isIE == true)
{
var oShell = new ActiveXObject("Shell.Application");
var filePath = "C:\\Windows";
var fileName = "notepad.exe";
var commandParms = "Hello World!";
oShell.ShellExecute(fileName,commandParms,filePath,"open","1");
return;
}
alert("Please use only IE to launch navigator.");
}
catch(e){
alert("Error:"+e.message);}
}
가짜! 인수를 전달할 수 있습니까? –
아니요, 없습니다. 유일한 방법은 필자가 파일을 작성하고 열어 본 것입니다. 또는 다음과 같이 winapi를 열어서 채울 수 있습니다. http://stackoverflow.com/questions/31021002/open-new-notepad-exe-and-write-content-to-it –