![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | File association bug? Hello, After doing the following: get-childitem -path env athext # for copy-paste in next commandset-item -path env athext -value".pl;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1" Perl scripts such as execute: c:\no\space\path.pl However, scripts with spaces in their path still need the prefix "perl" need to add perl: perl "c:\path with\space.pl" (No such problem in cmd.exe.) --Suresh |
My System Specs![]() |
| | #2 (permalink) |
| | Re: File association bug? "Suresh Govindachar" <sgovindachar@xxxxxx> wrote in message news:%23jLKNhs$HHA.4200@xxxxxx Quote: > Hello, > > After doing the following: > > get-childitem -path env athext # for copy-paste in next command> > set-item -path env athext -value> ".pl;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1" > Perl scripts such as execute: c:\no\space\path.pl > However, scripts with spaces in their path still need the prefix "perl" > need to add perl: perl "c:\path with\space.pl" > (No such problem in cmd.exe.) > > --Suresh > It's because what follows the space(s) are regarded as arguments to the script / program, unless you use the quotes. Some other alternatives Invoke-Item "c:\path with\space.pl" OR & "c:\path with\space.pl" Takes a bit of getting used to, though, I agree. -- Jon |
My System Specs![]() |
| | #3 (permalink) |
| | Re: File association bug? Quote: > It's because what follows the space(s) are regarded as arguments to the > script / program, unless you use the quotes. > > Some other alternatives > > Invoke-Item "c:\path with\space.pl" > OR > & "c:\path with\space.pl" Both cmd.exe and PS require quotes around filenames with spaces. However, In cmd.exe, one only needs the quotes; in cmd.exe, one need _not_ add anything to the "file name". in cmd.exe, just typing the "file name" causes it to be executed. But in PS one must _prepend_ the "file name" with perl or & to execute it. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: File association bug? "Suresh Govindachar" <sgovindachar@xxxxxx> wrote in message news:%23pKJZbv$HHA.1208@xxxxxx Quote: > Quote: >> It's because what follows the space(s) are regarded as arguments to the >> script / program, unless you use the quotes. >> >> Some other alternatives >> >> Invoke-Item "c:\path with\space.pl" >> OR >> & "c:\path with\space.pl" > Perhaps I was not clear: > Both cmd.exe and PS require quotes around filenames with spaces. > However, > In cmd.exe, one only needs the quotes; > in cmd.exe, one need _not_ add anything to the "file name". > in cmd.exe, just typing the "file name" causes it to be executed. > But in PS one must _prepend_ the "file name" with perl or & to execute > it. > > > PowerShell works slightly differently. If you type a set of characters in quotes then it's regarded as a string, which is why you can type things like $apples = 3 "There are $apples apples on the shelf" OR $a = "apple"; "apple".ToUpper() etc and those statements make sense. There are a lot of advantages to this in other areas. But returning to the point, when you type "c:\path with\space.pl" on its own, it's regarded as a string. -- Jon |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| lnk file association | Vista file management | |||
| how to restore .zip file association & file icon in Vista? | Vista file management | |||
| File association | Vista file management | |||
| File Association | Vista General | |||
| File association | Vista file management | |||