Running xp_cmdshell as Administrator
Does anyone know if it is possible to invoke xp_cmdshell as Administrator? I am working on trying to start the SQLSERVERAGENT service from TSQL but it fails with 'access denied' - from TSQL and from...
View ArticleXP_CMDSHELL Proxy Failover Cluster
I have 2 instances setup in an active active failover cluster. I am having some trouble setting up a proxy account for xp_cmdshell. When I set up xp_cmdshell proxy for a user lets call it "testuser" on...
View ArticleXp_cmdshell throw error with hyphen in server name
Hi, Please help me to resolve the issue. I am using BCP OUT to export data into text file. My server name has - (hyphen) like SERVER-NAME. BCP out is not recognising - (hyphen) and thows error. I tried...
View ArticleMove files from one folder to another
I am trying to move file from D:\try\t1.txt to folder D:\trycopy\ EXEC master..xp_cmdshell 'MOVE /Y D:\try\t1.txt /B D:\trycopy\' But its not moved. Error "The system cannot find the file specified."...
View ArticleHow To Configure xp_cmdshell To Access Remote Server?
Hi there, I'm trying to get xp_cmdshell to provide a directory listing of all files and folder on a remote server. When I run the command in a command prompt window it executes fine: dir \\files\1234...
View Articlewhat is the replacement of xp_cmdshell in sql server 2014 or 2008
Hi, I needs to read the zip files and write create the same zip file using sql server (with out xp_cmdsehll),Please help me
View Articlesometimes xp_cmdshell showing null
Hi sometimes xp_cmdshell showing null and sometimes its working fine... i dont know what wrong with this Any suggestions
View Articleexec master.dbo.xp_cmdshell variable error
PLease help. What is wrong with my TSQL? It states The filename, directory name, or volume label syntax is incorrect. DECLARE @databasename varchar (200) DECLARE @cmd varchar (300) DECLARE @pathfile...
View Articlesql agent job/xp_cmdshell batch file: How to capture output and/or error?
I am using a sql agent job that uses xp_cmdshell to execute a batch file. The batch file runs several sql scripts using sqlcmd. It appears to be working. However, I am unable to capture any error. If I...
View ArticleExecuting powershell from xp_cmdshell
I have a powershell file that looks to a directory and locks the fields on each of the Word documents that are contained in that directory. I am executing this powershell file from a SQL stored...
View Articleremote deleting files, where names are in a table, across servers
I have a table that lists file-names that have been created on an App server. Goal: I want to keep the list of files in the SQL server table and the list of files on disk on the App server in sync. The...
View ArticleI am trying to execute a vbscript program from a sql after insert trigger by...
My SQL Trigger code is IF OBJECT_ID('TRG_InsertEmp1') IS NOT NULL DROP TRIGGER TRG_InsertEmp1 GO CREATE TRIGGER TRG_InsertSyncEmp1 ON dbo.Emp_details AFTER INSERT AS BEGIN -- SET NOCOUNT ON added to...
View ArticleAltering credential ##xm_cmdshell_proxy_account## for xp_cmdshell
Current situation We have - 2 SQL Server 2014 instances (including the latest service packs) - each on a different Window 2012R2 machines. - with each a different windows accounts for the...
View ArticleSave PowerShell variables Within xp_cmdshell
Does anyone know if it is possible to save POWERSHELL variables when using xp_cmdshell when calling powershell code? The code below returns NULL when run from within SSMS but it should return HELLO as...
View ArticleUsing xp_cmdShell: I get 'access denied' copying a file from a server on a...
I have given my user (acg\\edc) full access to both folders. I have even got desperate enough to give 'everyone' access to the folder on the domain server to no avail. Please find the TransactSQL I...
View Article