| Author |
Topic |
|
hornet
Yak Posting Veteran
96 Posts |
Posted - 2006-05-05 : 04:21:07
|
Hi all! How can I execute exe file using xp_cmdshell? Thanks! |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-05-05 : 04:31:02
|
| xp_cmdshell is running dos commands like...exec xp_cmdshell 'dir *'also be cautious, you will get into lot of headaches if you expect user interaction with your exe file, e.g running notepad, msoffice, etc--------------------keeping it simple... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-05 : 04:34:19
|
>>exec xp_cmdshell 'dir *'should beexec Master..xp_cmdshell 'dir *' MadhivananFailing to plan is Planning to fail |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-05-05 : 04:39:59
|
yeah, if you're running it on a different database, no need if it's on master --------------------keeping it simple... |
 |
|
|
hornet
Yak Posting Veteran
96 Posts |
Posted - 2006-05-05 : 05:19:39
|
| I've been writting next: exec master..xp_cmdshell 'dir C:\Center.exe'. But itsn't running exe file. It show me information about this dir. I need to run file Center.exe. Help me please |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-05-05 : 05:25:10
|
exec master..xp_cmdshell 'C:\Center.exe' KH |
 |
|
|
hornet
Yak Posting Veteran
96 Posts |
Posted - 2006-05-05 : 05:41:47
|
| yea! I've done this. Process was ran, but it was invisible and my QueryAnalizer buzzed after I pressed F5 (Execute Query). I need simply to run this programm. |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2006-05-05 : 08:48:23
|
| Is the C:\xyz.exe on YOUR PC or on the C: of the SERVER?...there is a difference!!! |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-05-05 : 09:30:10
|
| what does your exe do?if you're loading a form or a program then sql won't do that for you...it will run exe that run as background processes like sql scripts, transfer tasks, bcp, sendmail, that sort of stuff, without user interactionit cannot instantiate exe's like notepad, you'll see it in task manager but you won't see the notepad loaded into windows--------------------keeping it simple... |
 |
|
|
hornet
Yak Posting Veteran
96 Posts |
Posted - 2006-05-10 : 01:32:09
|
Thanks a lot! I understood. |
 |
|
|
|