Jump to content

quotes in command ?


Go to solution Solved by michaelslamet,

Recommended Posts

Posted

im trying to run the following command By RunWait and there is quotes in the command I do not know how to process...

please help

this is what I need piped to the command line...

sqlcmd -S KITCHENSQLEXPRESSSQLuser -P SQLpassword -Q "BACKUP DATABASE testDatabase TO DISK='C:tempBackupsql.bak'"

I have this...

$server = "Kitchen\SQLEXPRESS
$user = "SQLuser
$password = "SQLPassword"

_RunWait "sqlcmd -S "&"  -U "&"$user"&" -P "&"$password   "

im getting lost where there is a quote in the original command that needs to be passed to the command line

  • Solution
Posted

Try this:

$server = "Kitchen\SQLEXPRESS"
$user = "SQLuser"
$password = "SQLPassword"

$command = "sqlcmd -S " & $server & $user & " -P " & $password & ' -Q "BACKUP DATABASE testDatabase TO DISK=' & "'C:\temp\Backupsql.bak'" & '"'

MsgBox(4096,"",$command)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...