Re: [help] parameter passing not working too well

L

Larry__Weiss

Are you running this from a cmd.exe prompt?

- Larry

On 5/19/2010 11:08 AM, Irwin wrote:

> powershell "\\server\win7\netsetup\include\CreateShortcuts.ps1"
> %ausm%\Programs\System\SIW.lnk -target %programfiles(x86)%\SIW\siw.exe -work
> %programfiles(x86)%\SIW
>
> nevermind the %ausm%, but this is the error I get:
>
> The term 'x86' is not recognized as the name of a cmdlet, function, script
> file
> , or operable program. Check the spelling of the name, or if a path was
> include
> d, verify that the path is correct and try again.
> At line:1 char:152
> + \\bbx\win7\netsetup\include\CreateShortcuts.ps1 -link
> C:\ProgramData\Microsof
> t\Windows\Start Menu\Programs\System\SIW.lnk -target C:\Program Files (x86
> <<<<
> )\SIW\siw.exe -work C:\Program Files (x86)\SIW
> + CategoryInfo : ObjectNotFound: (x86:String) [], CommandNotFound
> Exception
> + FullyQualifiedErrorId : CommandNotFoundException
>
>
> I know it has something to do with the brackets (x86).. But question now is,
> how do I make it work?
 

My Computer

J

Justin Rich

its seeing that as a function call.. not sure why, try quoting it?

it might have something to do with how the PS code is using it as well.. if
quoting it doesnt work, we'll need to see the code..

"Irwin" <[email protected]> wrote in message
news:[email protected]

> powershell "\\server\win7\netsetup\include\CreateShortcuts.ps1"
> %ausm%\Programs\System\SIW.lnk -target
> %programfiles(x86)%\SIW\siw.exe -work
> %programfiles(x86)%\SIW
>
> nevermind the %ausm%, but this is the error I get:
>
> The term 'x86' is not recognized as the name of a cmdlet, function, script
> file
> , or operable program. Check the spelling of the name, or if a path was
> include
> d, verify that the path is correct and try again.
> At line:1 char:152
> + \\bbx\win7\netsetup\include\CreateShortcuts.ps1 -link
> C:\ProgramData\Microsof
> t\Windows\Start Menu\Programs\System\SIW.lnk -target C:\Program Files (x86
> <<<<
> )\SIW\siw.exe -work C:\Program Files (x86)\SIW
> + CategoryInfo : ObjectNotFound: (x86:String) [],
> CommandNotFound
> Exception
> + FullyQualifiedErrorId : CommandNotFoundException
>
>
> I know it has something to do with the brackets (x86).. But question now
> is,
> how do I make it work?
 

My Computer

W

Wolfgang Kais

Irwin wrote:

> powershell "\\server\win7\netsetup\include\CreateShortcuts.ps1"
> %ausm%\Programs\System\SIW.lnk -target %programfiles(x86)%\SIW\siw.exe
> -work %programfiles(x86)%\SIW
>
> nevermind the %ausm%, but this is the error I get:
>
> The term 'x86' is not recognized as the name of a cmdlet, function,
> script file
[snip]

I don't have a 64 bit machine to test it, but just an idea:
since the path will contain blanks, how about enquoting the paths?

powershell "\\server\win7\netsetup\include\CreateShortcuts.ps1"
"%ausm%\Programs\System\SIW.lnk"
-target "%programfiles(x86)%\SIW\siw.exe"
-work "%programfiles(x86)%\SIW"

--
Kind regards,
Wolfgang Kais
 

My Computer

I

Irwin

Oh, before posting this, i've already tried enclosing with "". It doesn't
help. I did a test using echo $link with " and without. Results are the same.
Problem is the (), and yes, im running it from cmd and win7 64

"Wolfgang Kais" wrote:

> Irwin wrote:

> > powershell "\\server\win7\netsetup\include\CreateShortcuts.ps1"
> > %ausm%\Programs\System\SIW.lnk -target %programfiles(x86)%\SIW\siw.exe
> > -work %programfiles(x86)%\SIW
> >
> > nevermind the %ausm%, but this is the error I get:
> >
> > The term 'x86' is not recognized as the name of a cmdlet, function,
> > script file
> [snip]
>
> I don't have a 64 bit machine to test it, but just an idea:
> since the path will contain blanks, how about enquoting the paths?
>
> powershell "\\server\win7\netsetup\include\CreateShortcuts.ps1"
> "%ausm%\Programs\System\SIW.lnk"
> -target "%programfiles(x86)%\SIW\siw.exe"
> -work "%programfiles(x86)%\SIW"
>
> --
> Kind regards,
> Wolfgang Kais
>
>
> .
>
 

My Computer

Top