I need to be able to have links on a page be able to open other instances of PWB using different ini files. I have tried doing so via PWBExecute, but soon found that I can not send parameters to the executable so I could not open pwb.exe with a url and ini specified. Having to create .lnk files for each url and ini combination would be rather tedious. Is there some other way to have a link in a page open another instance of PWB using a specified url and/or ini file?
It may help for me to explain what I am trying to accomplish. I want to be able to use PWB as the shell on our public computers. Some of the computers are "Database" computers that provide access to only specific websites. So the shell instance of PWB will be displaying a page of links that open the various web databases, but these databases need to be opened using different ini files. Using shell buttons is not an option because I need to make the shell page look like a web page.
Thanks,
Jason
Getting links to open another instance of PWB?
Moderators: Tyler, Scott, PWB v2 Moderator
Getting links to open another instance of PWB?
Jason Weinstein
Application Support Technicain
Eugene Public Library
Eugene, OR
Application Support Technicain
Eugene Public Library
Eugene, OR
Hi Jason,
Have you read this...
http://www.teamsoftwaresolutions.com/ph ... .php?t=514
It touches on an issue like yours.
The main difference I can see is that you don't want to use different .lnk files. The only obvious alternative I can see is if you had batch files swap the ini file you need into a generic name:
copy dbA.ini pwb.ini
pwb.exe
or
copy dbB.ini pwb.ini
pwb.exe
You still need seperate files for each database however, so its fairly similar to .lnk files. Until you can can include arguments for PWBExecute you won't be able to do it inside the javascript. (Although I'm happy to be proven wrong. It would help me too.)
GregP
Have you read this...
http://www.teamsoftwaresolutions.com/ph ... .php?t=514
It touches on an issue like yours.
The main difference I can see is that you don't want to use different .lnk files. The only obvious alternative I can see is if you had batch files swap the ini file you need into a generic name:
copy dbA.ini pwb.ini
pwb.exe
or
copy dbB.ini pwb.ini
pwb.exe
You still need seperate files for each database however, so its fairly similar to .lnk files. Until you can can include arguments for PWBExecute you won't be able to do it inside the javascript. (Although I'm happy to be proven wrong. It would help me too.)
GregP
I thought for a moment about what I just said, and in the interests of proving myself wrong (before anyone else does ) I thing I found a solution.
Basically you use an ActiveX object to dynamically write the batch file for you inside the javascript. Below is a rather inelegant example which I haven't tried yet, but it's a starting point for you.
var shell = new ActiveXObject("WScript.Shell");
shell.Run("echo @echo off > dbA.bat", 0, true);
shell.Run("echo PWB C:\\Browser\\Local.html /INI=\"C:\\Browser\\PWB.INI\\" >> dbA.bat", 0, true);
shell.Run("dbA.bat", 0, true);
Double check whether I've escaped the appropriate characters.
GregP
Basically you use an ActiveX object to dynamically write the batch file for you inside the javascript. Below is a rather inelegant example which I haven't tried yet, but it's a starting point for you.
var shell = new ActiveXObject("WScript.Shell");
shell.Run("echo @echo off > dbA.bat", 0, true);
shell.Run("echo PWB C:\\Browser\\Local.html /INI=\"C:\\Browser\\PWB.INI\\" >> dbA.bat", 0, true);
shell.Run("dbA.bat", 0, true);
Double check whether I've escaped the appropriate characters.
GregP
In the new version of PWB v2.08.1, which will be released this week barring any major problems, includes added support for command line arguments in the Dynamic External Java Execute command.
http://www.teamsoftwaresolutions.com/beta/PWBv208r1.zip
Here is an example of the command using multiple command line arguments.
function OnClickExecute()
{
window.external.PWBExecute( "E:/PWB/PWB.exe", "/INI=E:/PWB/PWBa.INI www.google.com" )
}
Please let me know if you have any questions.
--Scott
http://www.teamsoftwaresolutions.com/beta/PWBv208r1.zip
Here is an example of the command using multiple command line arguments.
function OnClickExecute()
{
window.external.PWBExecute( "E:/PWB/PWB.exe", "/INI=E:/PWB/PWBa.INI www.google.com" )
}
Please let me know if you have any questions.
--Scott