iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old December 30th, 2006, 11:23 AM   #1
Reputable Member
 

Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 250
Thanks: 6
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Donny Bahama is on a distinguished road
Server side executables

This is probably super basic, but can someone get me started on how to execute a server-side executable via a link on a (client side) web page? I just want to click a button on a web page on the client and have it execute "ontheserver.bat".

I'm running IIS5 on a Windows XP machine. I'm using version 4.4.2 of php. Note that this is entirely internal - home LAN only - and I am the only user, so security is not an issue.

Last edited by Donny Bahama; December 30th, 2006 at 11:54 AM..
Donny Bahama is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 30th, 2006, 11:50 AM   #2
Reputable Member
 

Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 250
Thanks: 6
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Donny Bahama is on a distinguished road
Re: Server side executables

I found this thread: http://www.webforumz.com/php-forum/4...am-via-php.htm and I've read http://www.php.net/manual/en/function.exec.php but I'm getting an "unable to fork" error when trying to execute this code:
Code:
<?php
exec
('start /B "window_name" "notepad.exe"');
?>

Last edited by Donny Bahama; December 30th, 2006 at 11:55 AM..
Donny Bahama is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 30th, 2006, 12:53 PM   #3
Reputable Member
 

Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 250
Thanks: 6
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Donny Bahama is on a distinguished road
Re: Server side executables

I found the answer here: http://www.somacon.com/p255.php - sort of... it has to do with permissions for the Internet guest account "IUSR_WEB_SERVER_MACHINE_NAME". Now that I fixed that, it executes ontheserver.bat - which creates a directory and a test.txt file within the new directory - but the page itself doesn't return after running ontheserver.bat. It just sits there "Loading..."
Donny Bahama is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 30th, 2006, 01:33 PM   #4
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,131
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
Re: Server side executables

put an 'exit' as the last line of your bat.... if that doesnt work, try 'stop'
__________________
Rob - Webforumz Founder

I am currently NOT available for SEO consultancy work

My Sites: Student Midwife Forum, Costa Luz Holiday Rentals
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 30th, 2006, 01:59 PM   #5
Reputable Member
 

Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 250
Thanks: 6
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Donny Bahama is on a distinguished road
Re: Server side executables

LOL! Rob - you ROCK, my friend!

I had *just* figured that out and was coming back to post my findings! This works:
Code:
<?php
$ret 
system('start /B C:\website\usbuirt\ontheserver.bat');
?>
IF you use "exit" on the last line of the batch file.
Donny Bahama is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
lan , php , server side executables


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java server side technologies asim The Café 0 June 20th, 2007 03:47 AM
Trouble with Server Side Includes BGarner Classic ASP 3 January 20th, 2007 01:16 PM
attach server side code to asp:hyperlinkcolumn Totti .NET 0 October 14th, 2006 07:08 AM
Client-Side VS Server Side Scripting redev2006 JavaScript 1 July 30th, 2005 03:30 PM
ASP Include Files (SSI or Server Side Includes) administrator Classic ASP 3 August 15th, 2003 09:51 AM


Search Engine Optimization by vBSEO 3.2.0 RC8