Open folder and maximise the folder window

前端 未结 2 370
死守一世寂寞
死守一世寂寞 2021-01-16 07:20

I have the following simple Powershell script:

ii E:\\Source\\Development\\websites\\example.com.au\\root
ii E:\\Source\\Development\\websites\\example.com.a         


        
2条回答
  •  滥情空心
    2021-01-16 07:28

    Use AppActivate method, don't forget to send Enter key to gain focus, then Alt Spacebar X ("% X") to maximize.

    $folder = "C:\Temp"
    ii $folder
    Start-Sleep -m 100
    [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
    [Microsoft.VisualBasic.Interaction]::AppActivate("$folder")
    Start-Sleep -m 100
    [void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
    [System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
    [System.Windows.Forms.SendKeys]::SendWait("% X")
    

    Wrap a loop and you are all set.

提交回复
热议问题