Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 1st, 2008, 01:45 PM
Registered User
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default xp_cmdshell to run VBS file

Hi, I am trying to use xp_cmdshell to run a VBS file on a SQL server (ver 2000). The command I am running in query analyzer is
EXEC master..xp_cmdshell 'CScript "H:\PM_Apps\GP-TEST\LTS.vbs"'
I am getting this error:
Input Error: Can not find script file "H:\PM_Apps\GP-TEST\LTS.vbs".
I have verified that the file exists in that path by opening it in a notepad and it exists.
I know that xp_cmdshell runs as the SQL server agent account and the account has full access to this folder.
I am not sure why I am getting this error. Please advice.

Old December 1st, 2008, 02:09 PM
Registered User
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I figured it out. We have 2 SQL servvers running in a cluster. When I ran the SQL it was executing on an active node that had no folder structure that I am testing. When the other node was active I created folder structure and VBS files in it and it used to run.
Ever since failover it stopped working.
If I am not clear enough in my explanation please drop me a note. I
will try to explain a bit more.


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I attach a file to an email in my .vbs file savoym VBScript 3 July 2nd, 2011 08:02 AM
Question on .vbs file savoym VBScript 2 February 24th, 2005 12:12 PM
.NET EXE won't run right in SHELL from VBS Ron Howerton General .NET 1 December 20th, 2004 05:49 PM
Scheduling VBS file madhukp VBScript 1 September 22nd, 2004 07:14 AM
HELP with .VBS file savoym VBScript 1 July 31st, 2003 08:39 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.