批处理文件中的多个新浏览器窗口 [英] Multiple new browser windows from batch file

查看:52
本文介绍了批处理文件中的多个新浏览器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了许多与我的问题有关的主题.我的问题似乎很简单,但是我找不到最后一块,或者我只是忽略了明显的东西.我找到了多个答案,但没有一个可以上班.我只是想打开4个新的Chrome窗口,而不是标签页.我快到了实际上,我所使用的将打开每个窗口,并确定其大小和位置.但这要求我先关闭一个,然后再开始下一个.

I have read through many threads here relating to my issue. My problem seems simple, but I cant find the final piece, or I'm just overlooking something obvious. I have found multiple answers, but none that I can get to work. I am simply trying to open 4 new Chrome windows, not tabs. I am almost there. What I am using will in fact open each one up and size and position it. But it is requiring me to close one down before the next one will start.

@echo off
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window --window-position=1280,0 --window-size=640,512 "URL" 
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window --window-position=1920,0 --window-size=640,512 "URL 2" 
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window --window-position=1280,512 --window-size=640,512 "URL 3" 
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window --window-position=1920,512 --window-size=640,512 "URL 4"
exit

我还尝试了第二个bat文件,它将打开4个窗口并调整它们的大小,并且不需要我在下一个开始之前杀死浏览器窗口,但是它忽略了位置,因此它们都只是堆叠在一起.

I have also tried a second bat file, and it will open 4 windows and size them, and does not require me to kill the browser window before the next one will start, but it is ignoring the positioning, so they all just stack on top of each other.

@echo off
start chrome --new-window --window-position=1280,0 --window-size=640,512 "URL"
start chrome --new-window --window-position=1920,0 --window-size=640,512 "URL 2"
start chrome --new-window --window-position=1280,512 --window-size=640,512 "URL 3"
start chrome --new-window --window-position=1920,512 --window-size=640,512 "URL 4"
exit

我想念什么?如果有人可以帮我把我弄到最后一码,我将使用这两种方法.谢谢.

What am I missing? I will use either method if someone can just help get me that last yard. Thanks.

推荐答案

在评论部分感谢用户PA.因此,此问题似乎是Chrome的一个古怪之处.这有点单调乏味,尤其是如果您想使用多个窗口执行此操作.但是我在Chrome中创建了4个配置文件,然后在批次中分别对其进行了调用.这样就解决了问题.

Thanks to user PA in the comments section. So this issue appears to be a quirk of Chrome. Its a bit tedious, especially if you want to do this with several windows. But I created 4 profiles in Chrome and then called them each in the batch. This resolved the issue.

@echo off
start chrome --user-data-dir="C:\Users\(username)\AppData\Local\Google\Chrome\User Data\Default"--new-window --window-position=1280,0 --window-size=640,512 "URL"
start chrome --user-data-dir="C:\Users\(username)\AppData\Local\Google\Chrome\User Data\user2" --new-window --window-position=1920,0 --window-size=640,512 "URL 2"
start chrome --user-data-dir="C:\Users\(username)\AppData\Local\Google\Chrome\User Data\user3"--new-window --window-position=1280,512 --window-size=640,512 "URL 3"
start chrome --user-data-dir="C:\Users\(username)\AppData\Local\Google\Chrome\User Data\user4"--new-window --window-position=1920,512 --window-size=640,512 "URL 4"
exit

这篇关于批处理文件中的多个新浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆