OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Starting and minimizing Quake Terminal at startup

  • Thread starter Thread starter James Richardson
  • Start date Start date
J

James Richardson

Guest
I'm trying to create a WSF that I can run using Task Scheduler at login. I want it to open the Terminal, switch to Quake mode, minimize that and then close the orignal Terminal window. I've got as far as getting the Terminal to open, and activate Quake, but I'm not sure how to shift focus to the Quake Terminal in order to minimize it and then back to the original to exit out. Best method for this - possibly not, but I'm playing around with things so I'd like to stick to this if I can.

This is what I have so far

Code:
    <package>
        <job id="vbs">
            <script language="VBScript">
                Set objShell = WScript.CreateObject("WScript.Shell")
    
                Function SendKeysTo (process, keys, wait)
                    objShell.AppActivate(process.ProcessID)
                    objShell.SendKeys keys
                    WScript.Sleep wait
                End Function
    
                Set terminal= objShell.Exec("wt")
                WScript.Sleep 500
                
                SendKeysTo terminal, "^(`)", 1000 ' Works down to here
                SendKeysTo terminal, "^(`)", 1000 ' I'm guessing this is still trying to input to the first terminal window which doesn't have focus anymore
                SendKeysTo terminal, "exit{ENTER}", 1000
            </script>
        </job>
    </package>

I have the Quake shortcut changed to Ctrl+` as it cannot simulate a WinKey press, I'm okay with this.
<p>I'm trying to create a WSF that I can run using Task Scheduler at login. I want it to open the Terminal, switch to Quake mode, minimize that and then close the orignal Terminal window.
I've got as far as getting the Terminal to open, and activate Quake, but I'm not sure how to shift focus to the Quake Terminal in order to minimize it and then back to the original to exit out.
Best method for this - possibly not, but I'm playing around with things so I'd like to stick to this if I can.</p>
<p>This is what I have so far</p>
<pre><code> <package>
<job id="vbs">
<script language="VBScript">
Set objShell = WScript.CreateObject("WScript.Shell")

Function SendKeysTo (process, keys, wait)
objShell.AppActivate(process.ProcessID)
objShell.SendKeys keys
WScript.Sleep wait
End Function

Set terminal= objShell.Exec("wt")
WScript.Sleep 500

SendKeysTo terminal, "^(`)", 1000 ' Works down to here
SendKeysTo terminal, "^(`)", 1000 ' I'm guessing this is still trying to input to the first terminal window which doesn't have focus anymore
SendKeysTo terminal, "exit{ENTER}", 1000
</script>
</job>
</package>
</code></pre>
<p>I have the Quake shortcut changed to Ctrl+` as it cannot simulate a WinKey press, I'm okay with this.</p>
Continue reading...
 

Latest posts

Top