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

exec .cmd from xp_cmdshell 1

Status
Not open for further replies.

nice95gle

Programmer
Nov 25, 2003
359
US
Does anyone know how to change the directory using xp_cmdshell and then execute a cmd file from that directory?

I tried the following:
Code:
xp_cmdshell [COLOR=red]'c:\abcdef\file.cmd'[/color] [COLOR=green]--fails
[/color][COLOR=green]--and 
[/color]xp_cmdshell [COLOR=red]'cd c:\abcdef && file.cmd'[/color] [COLOR=green]--fails
[/color][COLOR=green]--and some other stuff I can't remember right now
[/color]

Well Done is better than well said
- Ben Franklin
 
Sweet...

Well Done is better than well said
- Ben Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top