![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
Execute Commands with Command Prompt
I've been working on a way to add a whole bunch of users to windows server 03. I've made one PHP file that will create me a batch file to add the users but that requires me to also run the batch file. I remembered seeing something on php.net about executing commands. I've tried system() and exec() and I've been getting these errors: "Warning: system() [function.system]: unable to fork [echo hello] in c:\inetpub\wwwroot\test.php on line 7" and "Warning: exec() [function.exec]: Unable to fork [dir] in c:\Inetpub\wwwroot\test.php on line 4". I was wondering if anyone had any info on this.
|
|
|
|
|
|
#2 |
|
Expert Programmer
|
http://ca3.php.net/manual/en/ref.exec.php
http://www.google.ca/search?hl=en&q=...G=Search&meta= Check those links at search google if you haven't already found a source or tutorial, or something you can refer to. If you have found something that you are following, post the link, and post some of your code. I've never done what you are trying to do here, but I figure you will probably geta response, or responses faster(and a solution) if you post some code. ![]() |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Apr 2006
Posts: 155
Rep Power: 3
![]() |
I haven't tried it too, but I would think you could use the system. But you say it doesn't work, so I don't know?
system("some command", $var);
if($var)
// Do something
__________________
-- v0id
|
|
|
|
|
|
#4 | |
|
Expert Programmer
|
Quote:
|
|
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Apr 2006
Posts: 155
Rep Power: 3
![]() |
Of course, I just gave it a try, maybe he didn't do it in that way.
__________________
-- v0id
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
If the application doesn't bring the ability to set some variables to the outside world, you're going to have to do some very arcane things to affect them. Does that answer your question? If ifs and buts were candy and nuts, we'd all have a Merry Christmas. Same goes for voodoo and unfounded guesses/hope.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 | |
|
Expert Programmer
|
Quote:
That is, unless he already figured it out.:p |
|
|
|
|
|
|
#8 | |
|
Hobbyist Programmer
Join Date: Apr 2006
Posts: 155
Rep Power: 3
![]() |
I know, as i said I just gave it a try, maybe it was it.
Quote:
__________________
-- v0id
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix commands compatible with Windows? | titaniumdecoy | Bash / Shell Scripting | 7 | Oct 5th, 2006 7:25 AM |
| PHP system commands | ktsirig | PHP | 6 | Oct 4th, 2005 1:24 AM |
| Execute File Batch Commands | johndoe | Other Programming Languages | 0 | Sep 2nd, 2005 8:00 AM |
| A simple script to execute a command package | satimis | Bash / Shell Scripting | 3 | Aug 12th, 2005 11:28 PM |
| how to send commands to a prompt? | acab | Python | 4 | Apr 28th, 2005 5:20 AM |