|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 644
|
how to use exec() in windows
I have run exec() method in windows using the following script:
PHP Code:
but i saw nothing in the output.Rather i saw the following line the log file: Quote:
Thanks |
|
|
|
|
|
|
#2 | |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 461
|
Quote:
CY, Captain Obvious |
|
|
|
|
|
|
#3 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 644
|
I would like to know the list of such commands that window supports.
|
|
|
|
|
|
#4 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Location: Cambridge, England
Posts: 781
|
You will probably need to change the ' to " if using in exec in a windows enviroment.
|
|
|
|
|
|
#5 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 644
|
|
|
|
|
|
|
#6 |
|
Previously, SilverBulletUK.
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Apr 2008
Location: North-East, UK.
Posts: 2,917
|
whoami isn't a valid windows operation.
![]() |
|
|
|
|
|
#7 |
|
Formerly 'arkinstall'
![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2006
Location: Powys, Mid Wales
Posts: 6,173
|
Exec simply runs a command on the system.
A simple way to see what works and what doesn't is to open the command line on the operating system. On windows, you can access the command line by hitting the windows key + 'R', then typing 'cmd' and hitting enter - that'll open up command prompt. On Linux it depends on your distro, but assuming you're using one with the default Gnome menu, it'll usually be under 'Applications' : 'Accessories' : 'Terminal'. PHP's exec function simulates you typing the command into that terminal. |
|
|
|
|
|
#8 | |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 461
|
Quote:
not sure you want it all ![]() |
|
|
|
|
|
|
#9 | |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 644
|
Thanks arkinstall.
you let me know the concept. I tried to run the command (ipconfig : which works from windows command line) as: PHP Code:
Quote:
|
|
|
|
|
|
|
#10 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 461
|
Same concept as in unix. Exactly
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 15:27.












Linear Mode
