I have several servers running, and I was trying to run this command from a remote server instead of a local one. So I was getting this error because the batch file was obviously not present on the remote server.
How to run a batch file in xp_cmdshell [closed]
-
30-05-2022 - |
Question
When I try to run this:
exec master..xp_cmdshell 'C:\f\alert.bat'
I get the following error message:
'C:\f\alert.bat' is not recognized as an internal or external command,
operable program or batch file.
How can I run this batch file using xp_cmdshell?
EDIT: The command above is verbatim. I am not using any parameter that has spaces in it.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow