• Re: running a program with spaces in Path with invoke-expression

    From John Hart@21:1/5 to OldDog on Fri Jun 10 09:30:26 2022
    On Wednesday, July 29, 2009 at 10:47:56 PM UTC-4, OldDog wrote:
    On Jul 29, 4:04 pm, tojo2000 <tojo2...@gmail.com> wrote:
    On Jul 29, 6:35 am, Marc Magnin <gu...@unknown-email.com> wrote:

    Hi,

    Start-Process is only available in PowerShell Community Extensions, unfortunately, these extensions are not available in our office...

    A good link about processes and powershell :
    'Windows PowerShell Blog : Managing Processes in PowerShell' (http://blogs.msdn.com/powershell/archive/2007/01/16/managing-processe...)

    -marc
    Pourquoi faire simple quand on peut faire compliqué ?!

    --
    Marc Magnin

    If you don't have Start-Process you could still try using

    [System.Diagnostics.Process]::Start($your_command)

    http://msdn.microsoft.com/en-us/library/system.diagnostics.process.st...
    Not to be old fashioned, but I use the Short Path name in these cases.
    You can find them by doing this:
    dir *. /x
    Volume in drive C is OS
    Volume Serial Number is 66AB-C4DB
    Directory of C:\
    04/18/2007 04:37 PM <DIR> ATI
    04/07/2007 12:53 PM <DIR> DELL
    04/02/2007 01:36 PM <DIR> doctemp
    04/02/2007 01:36 PM <DIR> Drivers
    06/20/2009 11:54 AM <DIR> ISO
    06/16/2007 11:46 PM <DIR> PHOTOS~1 Photoshop 7
    06/21/2009 01:29 PM <DIR> PROGRA~1 Program Files
    <-----
    07/17/2009 09:01 AM <DIR> PSTools
    07/12/2009 08:43 PM <DIR> Scripts
    09/15/2007 07:07 PM <DIR> STARTM~1 Start Menu
    06/28/2009 05:28 PM <DIR> Temp
    04/07/2007 12:25 PM <DIR> Users
    07/01/2009 05:41 PM <DIR> Windows
    Then this: dir "Program Files" /x
    Which shows you this:
    07/29/2009 03:07 AM <DIR> INTERN~1 Internet Explorer
    <----
    So your command line looks like this:
    "c:\Progra~1\INTERN~1\iexplore.exe"
    Works for me.
    OldDog

    Soooo this little trick worked like a charm for me just now! I appreciate you putting it out there, good ole 'OLD SCHOOL'!
    Thanks OldDog!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)