Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 3rd, 2005, 11:24 AM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Running cmd line .EXE through PHP

Hello to all!
I have a little problem...
I want to run a .exe file using php in Microsoft Windows XP. What i want to do is run a program for embedding a watermark in an image. So i have the agent.exe file that inserts the watermark into the image.
In windows I type simply in the command line: "agent path\blah-blah.jpeg path\blah-blah-new.jpeg". Now i want to do this through php for a website that I am developing...
I am new in php so I would like a little help.
Which is the right way? First use exec to call cmd.exe from WINDOWS\system32? Then use exec typing what i said above to watermark the image?
Even if it is so simple I tried it and the command exec('C:\WINDOWS\system32\cmd.exe'); doesn't do anything...

HEEELP...

Thanx in advance!!!

All you have to decide is what to do with the time that is given to you...
Reply With Quote
  #2 (permalink)  
Old January 6th, 2005, 02:30 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Someone help pleeeeeeeease... :(

All you have to decide is what to do with the time that is given to you...
Reply With Quote
  #3 (permalink)  
Old January 6th, 2005, 02:34 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Commands can be executed by enclosing the command in backticks.

$result = `agent path\blah-blah.jpeg path\blah-blah-new.jpeg`;

The results of the command are assigned to the variable.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running a batch file from cmd from C# Bill_Thompson C# 2 March 29th, 2008 07:56 AM
how to call shell cmd to open exe on clientside? nana Javascript How-To 6 May 25th, 2006 03:23 AM
Permission Denied using ftp cmd line avonsteen Classic ASP Components 0 May 11th, 2005 08:50 AM
PHP5 and php.exe php-cgi.exe php-win.exe freddo Beginning PHP 1 August 16th, 2004 09:28 AM



All times are GMT -4. The time now is 02:30 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.