Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfexecute and dos

Status
Not open for further replies.

e1plk01

Programmer
Joined
Nov 26, 2001
Messages
3
Location
US
I'm trying to use cfexecute to run a dos command and print the results to the dos_test.txt, but I'm having problems. Here is my cfexecute code:

<cfexecute name=&quot;c:\winnt\system32\cmd.exe&quot;
arguments=&quot;net user e1plk01 /domain&quot; outputfile=&quot;d:\web\appl_dev\basdev\DevEnvironment\dos_test.txt&quot;
timeOut=&quot;120&quot;></cfexecute>

( cfexecute has been enabled on the server)

Any idea what I can do to get this to run?

Thanks,
Pam




 
Try this:

<cfexecute name=&quot;c:\winnt\system32\cmd.exe&quot;
arguments=&quot;/c net user e1plk01 /domain&quot;
outputfile=&quot;d:\web\appl_dev\basdev\DevEnvironment\dos_test.txt&quot;
timeout=&quot;120&quot;/>
- tleish
 
Thanks for your suggestions!

I've tried them but I'm now getting this message: The syntax of this command is:
NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION | SHARE | START | STATISTICS | STOP |
TIME | USE | USER | VIEW ]

Here's my code:
<cfexecute name=&quot;c:\winnt\system32\net.exe&quot;
arguments=&quot;c/ NET USER E1PLK01 /DOMAIN&quot;
timeOut=&quot;120&quot;>

What am I missing?

Thanks,
Pam
 
Before you were running through the command line (cmd.exe). You need the &quot;/c&quot; before all arguments when useing cmd.exe. Also, you need to call the net.exe program, that's where &quot;NET&quot; comes from.

<cfexecute name=&quot;c:\winnt\system32\cmd.exe&quot;
arguments=&quot;/c net user e1plk01 /domain&quot;
timeout=&quot;120&quot;/>


Now, since you are calling net.exe directly there's no need for &quot;/c&quot; or &quot;NET&quot;

<cfexecute name=&quot;c:\winnt\system32\net.exe&quot;
arguments=&quot;user e1plk01 /domain&quot;
timeOut=&quot;120&quot;/>
- tleish
 
It worked!

You folks are gurus!

and fast!

Thanks a bunch for all your help.

pam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top