PWBExecute in v2.05

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
GregP
Benefactor
Benefactor
Posts: 90
Joined: Thu Mar 13, 2003 12:34 am
Location: QLD Australia

PWBExecute in v2.05

Post by GregP »

Has anyone experimented with the PWBExecute feature and run into problems?

I'm trying to get it to run a command:
"c:\digger\digger.exe qld1"

but it is refusing to work. I'm guessing that that the problem is the command parameter and was wondering if PWBExecute should be able to cope with this?

I can get the app working if I call a batch file that runs the command for me, but that means I have to put up with the dos console, when I would prefer it to just launch the Win32 app.

This works:
window.external.PWBExecute('c:\\html\\programs\\qld1.bat');

These don't:
window.external.PWBExecute('c:\\digger\\digger.exe qld1');
window.external.PWBExecute('c:\\digger\\digger.exe\ qld1');

Escaping the '\' character was just a guess in case the underlying code wasn't prepared for that character, because I couldn't get anything working at first. As you can see I tried escaping the space in case PWBExecute was skipping it or ending the string there, but no luck.

Any Suggestions?

Ta,
Greg

spragers
Benefactor
Benefactor
Posts: 153
Joined: Fri Dec 27, 2002 9:11 am
Contact:

Post by spragers »

I don't think that the \[space] is a valid escape sequence, but I could be wrong. Have you tried replacing the [space] with [%20] ?

GregP
Benefactor
Benefactor
Posts: 90
Joined: Thu Mar 13, 2003 12:34 am
Location: QLD Australia

Post by GregP »

I have, but it didn't work. I also tried passing 'qld1' as a second argument to the function. No luck.

Greg

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

It is the parameter that is causing the problem. PWB does not currently take into consideration there may be a command line parameter present.

Instead, create a shortcut to the application and add the command in the shortcut target line. Then point the PWB JavaExecute command to the shortcut.

window.external.PWBExecute( 'C:\\digger\\digger.lnk' )

This will also work with spaces in the path.

window.external.PWBExecute( 'C:\\Program Files\\Editor\\ED.lnk' )

Please note, the PWB Dynamic External Java Commands can be change to different keywords in the PWB INI file to help prevent applications being run from unauthorized web pages, and can be disabled by setting the keyword to blank.

For example the following only enables the JavaExecute with a differnt Java keyword command.

[Java]
JavaExit=
JavaActivity=
JavaRegister=
JavaHideToolbar=
JavaExecute=MyPWBExecuteCommand
JavaReadINIFile=

--Scott

GregP
Benefactor
Benefactor
Posts: 90
Joined: Thu Mar 13, 2003 12:34 am
Location: QLD Australia

Post by GregP »

Thanks Scott. Worked a treat.

Post Reply