Author |
|
A.P.B Newbie
Joined: January 11 2005 Location: United Kingdom
Online Status: Offline Posts: 13
|
Posted: September 27 2005 at 16:47 | IP Logged
|
|
|
After a prolonged absence I'm back. I have a .bat file I want to run via the web. Is it possible to set up one of the menu items on the homepage to run it, if so what command do I put in the URL field. If not any suggestions has to how to do it (with coding please as I know nothing about web programming - yet!)
Allan
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: September 27 2005 at 18:09 | IP Logged
|
|
|
Allan,
Simple enough (almost). You'll probably want to edit the pwrhome.ini file directly since the command will probably be too long for the PowerHome Explorer string (I'll fix this for the next version).
Anyways, the actual command will be:
/ph-cgi/evalformula?formula=ph_run('cmd.exe /c c:\yourpath\yourbat.bat')&nexturl=/ph-cgi/main
Just change the path and filename to match your batch file.
To manually make the change, open the pwrhome.ini file. Search for the [WebServer] section. You'll see some parameters "MENUTITLE1" to "MENUTITLE20" and "MENUURL1" to "MENUURL20". Pick the next available blank one and give an appropriate Title for MENUTITLE and then copy and paste the above URL for MENUURL. Save and reinitialize PowerHome.
If the path to your batch file contains spaces, then you'll need to wrap the path in double quotes. But, you'll have to escape them. A sample is posted below:
/ph-cgi/evalformula?formula=ph_run('cmd.exe /c %22c:\your path\yourbat.bat%22')&nexturl=/ph-cgi/main
Let me know if you have any problems.
Dave.
|
Back to Top |
|
|
A.P.B Newbie
Joined: January 11 2005 Location: United Kingdom
Online Status: Offline Posts: 13
|
Posted: October 29 2005 at 12:45 | IP Logged
|
|
|
Thanks, works a treat
|
Back to Top |
|
|