简体   繁体   English

在批处理文件中执行第二个命令

[英]executing a second command in a batch file

i have batch file that clears a value in the registry that is related to the usage block of chrome on a PC. 我有一个批处理文件,该文件清除了注册表中与PC上的chrome用法块相关的值。 every time i double click the batch file it will clear that value allowing an admin to use chrome. 每次我双击批处理文件,它将清除该值,从而允许管理员使用chrome。 i have a user that needs to access an EPA website but can only on chrome. 我有一个用户需要访问EPA网站,但只能使用chrome。 below is the code i tried to use but the second command after editing the registry does not run. 下面是我尝试使用的代码,但是编辑注册表后的第二条命令未运行。 it will never open a chrome webpage. 它永远不会打开Chrome网页。 i want their IE to stay default. 我希望他们的IE保持默认。 i will set chrome's homepage to the page she needs for simplicity. 为了简单起见,我将chrome的首页设置为她需要的页面。 how can i achieve the results i want? 我如何获得想要的结果?

REGEDIT4

; @ECHO OFF
; CLS
; REGEDIT.EXE /S "%~f0"
; EXIT

[HKEY_CURRENT_USER\Software\Policies\Google\Chrome\URLBlacklist]
"1"=- 
&
@echo off
start chrome.exe https://cdx.epa.gov/epa_home.asp

this is what i am trying to execute. 这就是我要执行的。

echo
reg delete HKEY_CURRENT_USER\Software\Policies\Google\Chrome\URLBlacklist /v 1 /f
echo done.

echo
start chrome.exe https://cdx.epa.gov/epa_home.asp
echo done.
reg delete HKEY_CURRENT_USER\Software\Policies\Google\Chrome\URLBlacklist /v 1 /f
"C:\Program Files\SomeFolder\chrome.exe" https://cdx.epa.gov/epa_home.asp

Your code is crazy. 您的代码太疯狂了。

I don't use non programmable browsers. 我不使用非可编程浏览器。 You'll have to fix the path. 您必须修复路径。 This works using WINDOWS. 使用WINDOWS可以使用。

"C:\Program Files\Internet Explorer\iexplore.exe" https://cdx.epa.gov/epa_home.asp

remove.reg 的remove.reg

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Policies\Google\Chrome\URLBlacklist]
"1"=-

remove.bat remove.bat

echo Removing 1st entry in URL blacklist...
regedit /S remove.reg
echo done.
echo Opening blocked site...
start chrome.exe https://cdx.epa.gov/epa_home.asp
echo done.

Whilst bizarre, it can be done in the style of the original 虽然很奇怪,但可以按照原始样式来完成

REGEDIT4

; @ECHO OFF
; CLS
; REGEDIT.EXE /S "%~f0"

[HKEY_CURRENT_USER\Software\Policies\Google\Chrome\URLBlacklist]
"1"=- 

; start chrome.exe https://cdx.epa.gov/epa_home.asp
; EXIT 

; ; indicates a comment in registry files but appears to be ignored when at the start of a batch file line. 表示注册表文件中的注释,但在批处理文件行的开头似乎被忽略。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在批处理文件中执行复制命令 - executing copy command in a batch file 关闭批处理文件时执行命令 - Executing a command when closing Batch file Windows 批处理文件更改第二条命令的位置 - Windows batch file changes the location for the second command Gawk命令未从批处理文件执行,但在命令行上正常 - Gawk command not executing from batch file but fine at command line 从批处理文件执行gradle命令时关闭命令窗口 - Command window closing while executing gradle command from batch file 使用Windows批处理文件读取文件内容并执行命令 - Reading file content using windows batch file and executing a command 通过在批处理文件中执行命令来获得多行响应? - Get multiple line response by executing command in batch file? 使用 windows 任务计划将批处理文件执行到新命令 window - executing a batch file into a new command window using windows task schedular 在第一个命令仍从批处理文件运行时启动第二个命令 - Starting a second command while the first is still running from a batch file Windows批处理文件 - 批处理文件在需要一段时间才能完成的命令后中途停止执行 - Windows Batch File - Batch File stops executing mid way after a command that takes a while to complete
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM