Page 1 of 1

Profound UI Run Command

Posted: Mon Oct 19, 2020 4:40 pm
by kodurivp
Hi,

I tried pui.runCommand() worked for the notepad.exe to open. But trying to open a file from C drive. Below are the commands that I tried , but seems like not working. Can you please help with this issue?


pui.runPCCommand("notepad.exe \\\\C:\\Koduri\\tst.txt");
pui.runPCCommand("notepad.exe \\\\C://Koduri//tst.txt");


Thanks
Koduri

Re: Profound UI Run Command

Posted: Mon Oct 19, 2020 4:46 pm
by Scott Klement
Try this:

Code: Select all

pui.runPCCommand("notepad.exe C:\\Koduri\\tst.txt");
The backslash character is used to escape message values in JavaScript (and many other languages) so you have to put two backslashes when you want a single backslash in the string. In this case, you want to have the standard Windows path of C:\Koduri\tst.txt so you have to code it as C:\\Koduri\\tst.txt

Its not clear why you had extra backslashes at the start of the path or why you placed foreslashes in the path. But, if you do need to add foreslashes for some reason, then you shouldn't double-them, as they are not an escaping character.

Re: Profound UI Run Command

Posted: Tue Oct 20, 2020 11:39 am
by kodurivp
Hey Thank you so much. It worked.