Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 使用批处理文件打开多个URL_Batch File_Url - Fatal编程技术网

Batch file 使用批处理文件打开多个URL

Batch file 使用批处理文件打开多个URL,batch-file,url,Batch File,Url,你好, 我有几个URL,我想用一个批处理文件打开它们,我在一个名为URL.bat的文件中使用了这个简单的脚本,在双击它时打开网页。它正在工作,但我想在每个URL之间增加三秒钟的延迟,因为它们一次打开所有URL,这会冻结机器。尝试使用超时或延迟功能,但运气不佳,无法再次将其全部打开。下面是我如何尝试去做的,有没有超时。 请注意,有一个问题与相同的问题,但我已经尝试了它的答案,它不工作: 谢谢 @echo off start chrome "http://google.com" start c

你好, 我有几个URL,我想用一个批处理文件打开它们,我在一个名为URL.bat的文件中使用了这个简单的脚本,在双击它时打开网页。它正在工作,但我想在每个URL之间增加三秒钟的延迟,因为它们一次打开所有URL,这会冻结机器。尝试使用超时或延迟功能,但运气不佳,无法再次将其全部打开。下面是我如何尝试去做的,有没有超时。 请注意,有一个问题与相同的问题,但我已经尝试了它的答案,它不工作:

谢谢

@echo off
start chrome  "http://google.com" 
start chrome  "http://yahoo.com" 
start chrome  "http://bing.com"


@echo off
start chrome  "http://google.com" 
Timeout 3
start chrome  "http://yahoo.com" 
Timeout 3
start chrome  "http://bing.com"

超时不适用,因为超时命令的语法错误,请尝试以下操作:

@echo off
start chrome  "http://google.com" 
Timeout /t 3
start chrome  "http://yahoo.com" 
Timeout /t 3
start chrome  "http://bing.com"

这将在打开下一个URL之前等待3秒,尽管3秒可能太快,但请尝试将其设置为5秒,甚至更多,可能是10秒。

超时对您不起作用,因为超时命令的语法错误,请尝试以下操作:

@echo off
start chrome  "http://google.com" 
Timeout /t 3
start chrome  "http://yahoo.com" 
Timeout /t 3
start chrome  "http://bing.com"

这将在打开下一个URL之前等待3秒,虽然3秒可能太快,但请尝试将其设置为5秒,甚至更多,可能是10秒。

您提供的脚本在我的Win10机器上运行。 自Win 7以来,
timeout
命令是标准的,在某些源代码工具包中提供该命令之前。 还有一个
sleep
命令,按键时无法绕过该命令


对于更复杂的批处理,您可以查看软件-AutoHotkey是一款免费的、开源的Windows宏创建和自动化软件,允许用户自动执行重复任务。它允许您等待窗口加载,然后继续下一步。查找
WinWait
命令。

您提供的脚本在我的Win10机器上运行。 自Win 7以来,
timeout
命令是标准的,在某些源代码工具包中提供该命令之前。 还有一个
sleep
命令,按键时无法绕过该命令


对于更复杂的批处理,您可以查看软件-AutoHotkey是一款免费的、开源的Windows宏创建和自动化软件,允许用户自动执行重复任务。它允许您等待窗口加载,然后继续下一步。查找
WinWait
命令。

对于Windows 10/8/7/2008/2012打开3选项卡谷歌浏览器,延迟3秒:

@echo off
start "" chrome "https://google.com" 
Timeout /t 3 /nobreak >nul 2>&1
start "" chrome "https://yahoo.com" 
Timeout /t 3 /nobreak >nul 2>&1
start "" chrome "https://bing.com"
@echo off
start "" chrome "https://google.com" 
ping timeout -n 1 >nul 2>&1
start "" chrome "https://yahoo.com" 
ping timeout -n 1 >nul 2>&1
start "" chrome "https://bing.com"
对于Windows XP打开3选项卡谷歌chrome应用程序,延迟3秒:

@echo off
start "" chrome "https://google.com" 
Timeout /t 3 /nobreak >nul 2>&1
start "" chrome "https://yahoo.com" 
Timeout /t 3 /nobreak >nul 2>&1
start "" chrome "https://bing.com"
@echo off
start "" chrome "https://google.com" 
ping timeout -n 1 >nul 2>&1
start "" chrome "https://yahoo.com" 
ping timeout -n 1 >nul 2>&1
start "" chrome "https://bing.com"
记住在chrome之前使用将URL添加为选项卡


对于Windows 10/8/7/2008/2012打开3选项卡谷歌浏览器,延迟3秒:

@echo off
start "" chrome "https://google.com" 
Timeout /t 3 /nobreak >nul 2>&1
start "" chrome "https://yahoo.com" 
Timeout /t 3 /nobreak >nul 2>&1
start "" chrome "https://bing.com"
@echo off
start "" chrome "https://google.com" 
ping timeout -n 1 >nul 2>&1
start "" chrome "https://yahoo.com" 
ping timeout -n 1 >nul 2>&1
start "" chrome "https://bing.com"
对于Windows XP打开3选项卡谷歌chrome应用程序,延迟3秒:

@echo off
start "" chrome "https://google.com" 
Timeout /t 3 /nobreak >nul 2>&1
start "" chrome "https://yahoo.com" 
Timeout /t 3 /nobreak >nul 2>&1
start "" chrome "https://bing.com"
@echo off
start "" chrome "https://google.com" 
ping timeout -n 1 >nul 2>&1
start "" chrome "https://yahoo.com" 
ping timeout -n 1 >nul 2>&1
start "" chrome "https://bing.com"
记住在chrome之前使用将URL添加为选项卡

毫不延迟地启动3个Chrome实例是一个问题,您可以在两个实例之间延迟几秒钟来解决

但是为什么不在一个Chrome实例中打开所有三个URL呢

是的,可以在启动Chrome时在命令行上指定多个URL。

毫不延迟地启动3个Chrome实例是一个问题,您可以在两个实例之间延迟几秒钟来解决

但是为什么不在一个Chrome实例中打开所有三个URL呢


是的,可以在启动Chrome时在命令行上指定多个URL。

正如您在使用
timeout/?
时所看到的那样,/t不是必需的,
timeout 3
工作得非常好。这就是为什么它说的是
TIMEOUT[/T]TIMEOUT[/NOBREAK]
而不是
TIMEOUT[/T TIMEOUT][/NOBREAK]
@DennisvanGils我不知道,没有
/T
我从来没有试过,他仍然声称没有
/T
它就不能工作,也许他在一个旧的操作系统上,不管怎样,可能只是3还不够,因为在最后一个URL加载完成之前,它仍然会打开下一个URL,所以5秒或10秒会更好。我想可能就是这样,他正试图在上一个页面之后快速加载下一个页面。这可能是因为从零开始打开浏览器比在已打开的浏览器中加载新选项卡花费的时间更长。使用/t和不使用/t进行了尝试,延迟了,没有中断,尝试了脚本的几种变体,但没有成功。正如您在使用
timeout/?
时所看到的那样,不需要/t,并且
超时3
工作正常。这就是为什么它说的是
TIMEOUT[/T]TIMEOUT[/NOBREAK]
而不是
TIMEOUT[/T TIMEOUT][/NOBREAK]
@DennisvanGils我不知道,没有
/T
我从来没有试过,他仍然声称没有
/T
它就不能工作,也许他在一个旧的操作系统上,不管怎样,可能只是3还不够,因为在最后一个URL加载完成之前,它仍然会打开下一个URL,所以5秒或10秒会更好。我想可能就是这样,他正试图在上一个页面之后快速加载下一个页面。这可能是因为从零开始打开浏览器比在已打开的浏览器中加载新选项卡所需的时间更长。使用/t和不使用/t进行尝试,延迟,不中断,尝试了脚本的几种变体,但没有成功。
ping timeout-n 1>nul 2>&1
会立即在Windows XP以及更高版本的Windows上继续批处理。正确的将是
%SystemRoot%\System32\ping.exe 127.0.0.1-n 4>nul
,延迟3秒。它同时打开了所有三个,我使用的是windows 8。这可能是个问题吗?
ping timeout-n1>nul2>&1
会导致在Windows XP和更高版本的Windows上立即继续批处理。正确的将是
%SystemRoot%\System32\ping.exe 127.0.0.1-n 4>nul
,延迟3秒。它打开了所有