veedub Posted July 9, 2007 Share Posted July 9, 2007 Hello! I have a web page on an intranet, i need to run a command in the local windows run from the webpage. for example when you press a button button on a webpage it has the same effect as running cmd from the run prompt on the local machine. Anyone know how to do this? cheers. Link to comment https://forums.phpfreaks.com/topic/59061-running-a-windows-command-line-from-a-web-page/ Share on other sites More sharing options...
matto Posted July 9, 2007 Share Posted July 9, 2007 Something like this should do the job. $cmd = "del old_file.txt"; system($cmd); The above example would remove a file named "old_file.txt". The above assumes the file is in the same directory as the PHP script. Of course the script would need the right permissions to remove the file.... Link to comment https://forums.phpfreaks.com/topic/59061-running-a-windows-command-line-from-a-web-page/#findComment-293174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.