[batch] hsatrt calliung powershell ps1

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

  1. thethingy

    thethingy MDL Senior Member

    Sep 7, 2010
    301
    41
    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
    815
    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
     
  3. thethingy

    thethingy MDL Senior Member

    Sep 7, 2010
    301
    41
    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
    815
    10
  5. stayboogy

    stayboogy MDL Addicted

    May 1, 2011
    846
    215
    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