Computing.Net > Forums > Programming > Batch - Pushd & executing script?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch - Pushd & executing script?

Reply to Message Icon

Name: mflair2000
Date: May 20, 2009 at 07:11:21 Pacific
OS: Windows Vista
Subcategory: Batch
Comment:

hello; i'm having a bit of an issue executing a script on a mapped drive; after using PUSHD; can someone please take a look.

declare @CMDSQL varchar(4000)
declare @ScriptDrive varchar(4000)
declare @ScriptLocation varchar(4000)
declare @ScriptName varchar(4000)

set @ScriptLocation = '\\MappedDrive\Database\'
set @ScriptDrive = 'D:'
set @ScriptName = 'cleanupJob.vbs'
set @CMDSQL = 'pushd ' + @ScriptLocation + ' & ' + 'cscript ' + @ScriptLocation + @Scriptname
print @CMDSQL

EXEC master..xp_CMDShell @CMDSQL






Sponsored Link
Ads by Google

Response Number 1
Name: reno
Date: May 20, 2009 at 10:59:44 Pacific
Reply:

try adding "cmd /c" to the execute method

correct the below syntax since i don't know the language syntax:
EXEC master..xp_CMDShell 'cmd/c "' + @CMDSQL + '"'


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch - Pushd & executing script?

Batch or windows script www.computing.net/answers/programming/batch-or-windows-script/14593.html

Batch script: Help with FOR file IO www.computing.net/answers/programming/batch-script-help-with-for-file-io/14915.html

Need Help with DOS batch file .. www.computing.net/answers/programming/need-help-with-dos-batch-file-/12751.html