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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what's wrong with this command

Status
Not open for further replies.

adibzo

Technical User
Aug 11, 2003
2
US
exec [file nativename "c:/WINNT/system32/cmd.exe /c start "]

I am trying to launch a shell to run a telnet within from an tcl command but i am failing to execute the /c start part
i get the following error
exec return: "couldn't execute "c:\WINNT\system32\cmd.exe \c start ": invalid argument"
thanks in advance
 
The command [file nativename] gets a standard file name and returns a file name adapted to the underlying OS.
The /c and start arguments are arguments for the [exec] command, not the [file] command.
Try:
Code:
  exec [file nativename "c:/WINNT/system32/cmd.exe"] /c start
In fact, exec does the job for you and you don't need in this case [file nativename]. And because cmd.exe is on the standard path you can code:
Code:
  exec cmd /c start
HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top