Answered
How do I hide this blinking window
system('start /min reg add "HKEY_CURRENT_USER\\Software\\abcdefg" /f')
When this code runs, the window flashes

system('start /min reg add "HKEY_CURRENT_USER\\Software\\abcdefg" /f')
When this code runs, the window flashes

var ret = run_cmd('reg add "HKEY_CURRENT_USER\\Software\\abcdefg" /f', false, false);
alert(ret);
/////////////////////////////////////////////////
function run_cmd(cmd, visible, wait)
{
try {
var tmp_name = "tmp.js";
var file = new File(Folder.temp.fsName + "\\" + tmp_name);
file.open("w");
file.encoding = "UNICODE-1-1-UTF-8";
if (file.error) throw(file.error);
file.writeln("WScript.CreateObject(\"WScript.Shell\").Run(" + cmd.toSource() + "," + (visible?"1":"0") + "," + (wait?"true":"false") + ");");
file.writeln("with(new ActiveXObject(\"Scripting.FileSystemObject\")) GetFile(GetSpecialFolder(2).Path+\"\\\\\"+\"" + tmp_name + "\").Delete();");
if (file.error) throw(file.error);
file.close();
file.execute();
var ok = false;
try {
while (1)
{
if (!file.exists) { ok = true; break; }
set_performance("stepByStep");
}
}
catch(e) { }
set_performance("accelerated");
return ok;
}
catch(e) { alert(e); }
}
/////////////////////////////////////////////////
function set_performance(mode)
{
try {
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("playbackOptions"));
r.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
d.putReference(stringIDToTypeID("null"), r);
var d1 = new ActionDescriptor();
d1.putEnumerated(stringIDToTypeID("performance"), stringIDToTypeID("performance"), stringIDToTypeID(mode));
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("playbackOptions"), d1);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
}
catch (e) { throw(e); }
}Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.