Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - params containing blanks

Reply
 
Old 06-20-2007   #1 (permalink)
Jay


 
 

params containing blanks

This is an example of a cmd script I need to run:

powershell .\startSybaseSvcs "FglClient_ch-xxxx-01" "SYSAM" "Sybase
SQLServer _ CHXXXX01" "Sybase BCKServer _ CHXXXXO01_BS"

The problem is that the 3rd and 4th parameters contain blanks, so the
startSybaseSvcs script is picking up params 3 and 4 as 'Sybase' and
'SQLServer'. How can I pass across the parameters so that they're picked up
as intended, containing blanks?

Jay



My System SpecsSystem Spec
Old 06-20-2007   #2 (permalink)
Neil Chambers


 
 

Re: params containing blanks

On 2007-06-20 14:28:52 +0100, "Jay" <j@b.com> said:

> This is an example of a cmd script I need to run:
>
> powershell .\startSybaseSvcs "FglClient_ch-xxxx-01" "SYSAM" "Sybase
> SQLServer _ CHXXXX01" "Sybase BCKServer _ CHXXXXO01_BS"
>
> The problem is that the 3rd and 4th parameters contain blanks, so the
> startSybaseSvcs script is picking up params 3 and 4 as 'Sybase' and
> 'SQLServer'. How can I pass across the parameters so that they're
> picked up as intended, containing blanks?
>
> Jay


Try escaping the space

"Sybase` SQLServer..." "Sybase` BCKServer..."

n

My System SpecsSystem Spec
Old 06-20-2007   #3 (permalink)
Jay


 
 

Re: params containing blanks

I worked out how to do it.

powershell .\startSybaseSvcs "FglClient_ch-xxxx-01" "SYSAM" "Sybase`
SQLServer` _` CHXXXX01" "Sybase` BCKServer` _` CHXXXXO01_BS"

does the trick. It all became clear after a pint of Guinness.

Jay


"Jay" <j@b.com> wrote in message
news:es8t76zsHHA.1776@TK2MSFTNGP03.phx.gbl...
> This is an example of a cmd script I need to run:
>
> powershell .\startSybaseSvcs "FglClient_ch-xxxx-01" "SYSAM" "Sybase
> SQLServer _ CHXXXX01" "Sybase BCKServer _ CHXXXXO01_BS"
>
> The problem is that the 3rd and 4th parameters contain blanks, so the
> startSybaseSvcs script is picking up params 3 and 4 as 'Sybase' and
> 'SQLServer'. How can I pass across the parameters so that they're picked
> up as intended, containing blanks?
>
> Jay
>



My System SpecsSystem Spec
Old 06-20-2007   #4 (permalink)
Jay


 
 

Re: params containing blanks

Thanks Neil.


"Neil Chambers" <n3llyb0y@aol.com> wrote in message
news:2007062014480882327-n3llyb0y@aolcom...
> On 2007-06-20 14:28:52 +0100, "Jay" <j@b.com> said:
>
>> This is an example of a cmd script I need to run:
>>
>> powershell .\startSybaseSvcs "FglClient_ch-xxxx-01" "SYSAM" "Sybase
>> SQLServer _ CHXXXX01" "Sybase BCKServer _ CHXXXXO01_BS"
>>
>> The problem is that the 3rd and 4th parameters contain blanks, so the
>> startSybaseSvcs script is picking up params 3 and 4 as 'Sybase' and
>> 'SQLServer'. How can I pass across the parameters so that they're picked
>> up as intended, containing blanks?
>>
>> Jay

>
> Try escaping the space
>
> "Sybase` SQLServer..." "Sybase` BCKServer..."
>
> n
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Is there a better way how to get command-line params like WSH ? PowerShell
Passing function params by ref? PowerShell
display blanks out Vista hardware & devices
how do you pass named params to funcs by way of variables PowerShell
passing params to windows commands PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46