I'm trying to run a xp_cmdshell to execute a program and thought I'd test it by opening notepad. However when I execute the command it just keeps on executing without returning results or opening notepad. Then, when I try to cancel the execution, the cancel just keeps running and won't cancel the execution.
I know how to stop the cancel , but how do I avoid this in the first place? What am I doing wrong in the execution?
DECLARE @command varchar(8000)
SET @command = 'C:\Windows\System32\notepad.exe'
EXEC master..xp_cmdshell @command