[batch] hsatrt calliung powershell ps1

Discussion in 'Scripting' started by thethingy, Dec 7, 2011.

  1. thethingy

    thethingy MDL Senior Member

    Sep 7, 2010
    301
    40
    10
    #1 thethingy, Dec 7, 2011
    Last edited by a moderator: Apr 20, 2017
    anyone know the way to get hstart working with this;

    Code:
    powershell -command "& $env:temp\merge1.ps1"
    
    works no problem straight from the cmd line but I dont want the console to be visible in powershell, or anyone know how to hide the powershell completely?
     
  2. woot332

    woot332 MDL Senior Member

    Feb 18, 2011
    390
    810
    10
    #2 woot332, Dec 7, 2011
    Last edited: Dec 7, 2011
    i think you could use the showwindow api

    simple asm example:

    .data
    winname db "Windows PowerShell",0

    .code
    start:
    invoke FindWindow,0,addr winname
    invoke ShowWindow,eax,SW_HIDE ; hide window
    invoke Sleep,5000 ; 5 sec delay
    invoke FindWindow,0,addr winname
    invoke ShowWindow,eax,SW_SHOWNORMAL ; restore window
    invoke ExitProcess,0
    end start
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. thethingy

    thethingy MDL Senior Member

    Sep 7, 2010
    301
    40
    10
    thanks, you wouldn't know how to configure that from a batch or registry?
     
  4. woot332

    woot332 MDL Senior Member

    Feb 18, 2011
    390
    810
    10
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. stayboogy

    stayboogy MDL Addicted

    May 1, 2011
    712
    116
    30
    hstart /NOCONSOLE powershell -command "& $env:temp\merge1.ps1"

    i would think. don't know for sure haven't been using hstart in a while

    i may be misunderstanding what you are wanting though
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...