Új hozzászólás Aktív témák

  • simisoma22

    csendes tag

    válasz kraftxld #44404 üzenetére

    Hmmm...

    nem lett jobb a helyzet:

    Kód: $proc = $null
    $proc = get-process -ProcessName DOSPrinter
    if ($proc -eq $null)
    {
    Start-Process "C:\Program Files\DOS Printer\start.bat"
    }

    Eredmény:
    Windows PowerShell
    Copyright (C) 2009 Microsoft Corporation. All rights reserved.

    PS Z:\> $proc = $null
    PS Z:\> $proc = get-process -ProcessName DOSPrinter
    Get-Process : Cannot find a process with the name "DOSPrinter". Verify the proc
    ess name and call the cmdlet again.
    At line:1 char:20
    + $proc = get-process <<<< -ProcessName DOSPrinter
    + CategoryInfo : ObjectNotFound: (DOSPrinter:String) [Get-Process
    ], ProcessCommandException
    + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.
    Commands.GetProcessCommand

    PS Z:\> if ($proc -eq $null)
    >> {
    >> Start-Process "C:\Program Files\DOS Printer\start.bat"
    >> }

    :W :W :W :W :O

Új hozzászólás Aktív témák