Executing a local program via exec() in PHP

  • RockmanTV
  • Proficient
  • Proficient
  • RockmanTV
  • Posts: 348

Post 3+ Months Ago

Alright, so I'm fairly new to the Program execution Functions in PHP and what I'm trying to do, as a simple example, is open up the calculator program when I run my script. Here's my code:

Code: [ Select ]
exec('c:\\Windows\\System32\\calc.exe');


To me this seems pretty straightforward, but when I run it the script hangs and does nothing. When I type 'c:\\Windows\System32\calc.exe' into cmd it runs fine. Any tips I'm missing?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • RockmanTV
  • Proficient
  • Proficient
  • RockmanTV
  • Posts: 348

Post 3+ Months Ago

I should also say that I am running the script in a local WAMP environment.

Also tried this using the following php code:
Code: [ Select ]
$shell = new COM("WScript.Shell");
$shell->Run("notepad.exe");
$shell = null;
  1. $shell = new COM("WScript.Shell");
  2. $shell->Run("notepad.exe");
  3. $shell = null;


In this case nothing happens. Any ideas for someone who's new to this sort of thing?

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 91 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.