Trouble with spaces in the args

by sqlpadawan at 2013-02-21 11:09:42

I’m having trouble with spaces in the args.


# sql server 2008 path
$DTSPath = (Get-ItemProperty -path “HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\100\SSIS\Setup\DTSPath”).’(default)’

#C:\Program Files\Microsoft SQL Server\100\DTS\Binn<br>$BinnPath = = $DTSPath + "BINN&quot;

#C:\Program Files\Microsoft SQL Server\100\DTS\Packages<br>$PackagePath = $DTSPath + "Packages&quot;

$BinnPath = $DTSPath + "BINN&quot;
$PackagePath = $DTSPath + "Packages&quot;

$cmd = $BinnPath + “dtutil.exe”
$arg1 = “-file C:\Users\bullenkr\Documents\Visual Studio 2008\Projects\TestDeployment\TestDeployment\bin\Deployment\TestDeployment.dtsx”
$arg2 = “-copy FILE`;$PackagePath\TestDeployment.dtsx’”;

& $cmd $arg1 $arg2;

Write-Host $LastExitCode;


When I run it, it pops an error on $arg1;

Option “Studio” is not valid.
6

I know this should be easy, but I can’t seem to get it today.

Any ideas?
by ArtB0514 at 2013-02-21 12:49:39
See if this way (an extra set of quote marks) works:
$arg1 = ‘-file “C:\Users\bullenkr\Documents\Visual Studio 2008\Projects\TestDeployment\TestDeployment\bin\Deployment\TestDeployment.dtsx”’