Hi all
I have attached an example (where you probably need to adapt the registry key).
- They very first time I get an error/nothing happens because reg.exe is too slow. The result file huhu1.txt is created, but too late for the DOpus script.
- If I manipulate huhu1.txt, the next time the file is not overwritten. But the syntax seems to be OK because from a DOS shell the result file is always overwritten.
So, runCommand seems not to fork correctly. Is there a workaround or do I make something wrong? If yes, can someone point out the proper way.
Aloha
Uwe
function OnClick(data) {
var dlg = DOpus.Dlg;
var doCmd = DOpus.NewCommand;
var FSUtil = DOpus.FSUtil;
var StringTools = DOpus.Create.StringTools();
doCmd.RunCommand("reg.exe export \"HKLM\\SOFTWARE\\WOW6432Node\\Apache Software Foundation\\Procrun 2.0\\Tomcat8\\Parameters\\Java\" \"c:/huhu1.txt\"");
var myText = FSUtil.OpenFile("c:\\huhu1.txt").Read();
myText = StringTools.Decode(myText,"auto"); //[utf16 be|utf16 le|auto]
// var result = myText.match(/"Jvm"="(.+?)"/);
dlg.window = DOpus.Listers(0);
dlg.template = "dialog";
dlg.detach = true;
dlg.Show();
dlg.Control("edit1", "dialog").value = myText;
while (true) {
msg = dlg.GetMsg();
if (!msg.result) { break; }
}
}