从批处理文件中启动chrome

时间:2018-04-12 10:14:34

标签: python django windows batch-file

我有django应用程序,我可以从批处理文件开始。我想启动地址为http://localhost:8000/的谷歌浏览器。我尝试了不同的解决方案,但仍然没有启动Chrome。服务器被激活

我的蝙蝠脚本

@echo off
cmd /k "cd /d C:\Users\user1\Desktop\Website\code\myenvironment\Scripts & activate & cd /d    C:\Users\user1\Desktop\Website\code\myapp & python manage.py runserver"


start C:\"Program Files (x86)"\Google\Chrome\Application\chrome.exe "http://localhost:8000/"

1 个答案:

答案 0 :(得分:0)

您可以在this documentation中找到start命令语法:

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
[command/program] [parameters]

所以我建议执行:

@echo off cmd /k "cd /d C:\Users\user1\Desktop\Website\code\myenvironment\Scripts & activate & cd /d    C:\Users\user1\Desktop\Website\code\myapp & python manage.py runserver"

start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "http://localhost:8000/"