eKg1 Posted December 28, 2017 Posted December 28, 2017 Hello everyone! I recently ordered a Rubber Ducky and while I wait for it to get here I thought I would start setting up a script. What I want to do in short is the following.. 1. Open Powershell as Admin ✔ 2. Bypass UAC ✔ 3. Change the PS window size ✔ 4. Open Google Chrome in a NEW window, not as a new tab. The reasoning behind this is because I would like to open the Chrome window in front of the PS window so it can be hidden during script execution. I would potentially even want to open 3 or 4 tabs in the new window. I spent quite a bit of time trying to figure out how to open a new window but most of the time I could only open a new tab. (Yes, I had Chrome open during testing of the command via powershell. Any suggestions/improvements/ideas are greatly appreciated! I look forward to unleashing the DUCK. DELAY 1000 GUI r DELAY 100 STRING powershell Start-Process powershell -Verb runAs ENTER DELAY 2000 ALT y DELAY 1000 REM Obfuscate the powershell window STRING mode con:cols=18 lines=1 ENTER STRING Start-Process "chrome.exe" "www.google.com" Quote
n00shE Posted December 28, 2017 Posted December 28, 2017 The following should open a new window. Add lines after with web addresses to open tabs in that new window. Start-Process "chrome.exe" Quote
eKg1 Posted December 28, 2017 Author Posted December 28, 2017 12 hours ago, n00shE said: The following should open a new window. Add lines after with web addresses to open tabs in that new window. Start-Process "chrome.exe" n00shE, Thank you for the suggestion but this will only add a new tab to Chrome if Chrome is already opened. I am wanting to open a new window only, not a new tab. Quote
eKg1 Posted December 28, 2017 Author Posted December 28, 2017 17 minutes ago, eKg1 said: n00shE, Thank you for the suggestion but this will only add a new tab to Chrome if Chrome is already opened. I am wanting to open a new window only, not a new tab. Hm, Well, I may be completely wrong here. It's strange, when I run "Start-Process "Chrome.exe"" on another machine, it pulls up Chrome in a separate window when Chrome is ALREADY open, but on my current machine it opens in a new tab when Chrome is open. Maybe I'm just crazy. Thanks for the help. Quote
s31064 Posted July 15, 2021 Posted July 15, 2021 I have this to open a new window in one of my scripts, where $Browser is declared above: Start-Process $Browser ('--new-window', '--start-maximized', 'about:blank') -ErrorVariable Test Then to open more tabs in that same window, I use this, where $URL is pulled from an array: Start-Process $Browser $URL -ErrorVariable Test NOTE: This works with Edge, Chrome and Firefox. It does not work with IE. IE requires COM-Object coding to open tabs in the new window you opened in the first line. Otherwise the URLs you expect to be in new tabs all open in new windows. Quote
Irukandji Posted July 15, 2021 Posted July 15, 2021 Necro a dead topic. 3 years later.. Check the date of the post it's a bit dead.. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.