0
我需要使对用户完全不可见的帮助。需要使批处理脚本中的命令对用户不可见
我以前见过这个。目前,它回答了一个问题,不会自动将用户从PC上注销,但我希望可以在视觉上关闭该批次,但在后台完成gpupdate。
@echo off
Title Internet Explorer Full Reset
::Close Internet Explorer tasks
taskkill.exe /f /im iexplore.exe
::Wait
timeout /t 4
::Performs reset on all settings for Internet Explorer
reg delete "HKCU\Software\Microsoft\Internet Explorer" /f
::Wait
timeout /t 2
::Clear all temporary internet files
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
::Clear all cookies
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
::Clear all form data
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16
::Wait
timeout /t 1
:: Set IE to always check for new versions of pages automatically
::reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /V SyncMode5 /t REG_DWORD /d 3 /f
::Wait
timeout /t 1
::Enable favorites bar in Internet Explorer
REG ADD "HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MINIE" /V "LinksBandEnabled" /D "00000001" /F
::Enable menu bar in Internet Explorer
REG ADD "HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MINIE" /V "AlwaysShowMenus" /D "00000001" /F
::Enable command bar in Internet Explorer
REG ADD "HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MINIE" /V "CommandBarEnabled" /D "00000001" /F
::Enable status bar in Internet Explorer
REG ADD "HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MINIE" /V "ShowStatusBar" /D "00000001" /F
::Relaunch Internet Explorer
start iexplore.exe
::Update Group Policy to bring all Internet Explorer settings back into compliance
echo N | gpupdate /force
::Schedule task to reboot at 11:59PM
::schtasks /create /sc once /tn restart /tr "shutdown -r -f ""restart""" /st 23:59
::Message To User
msg * "Please restart your computer to complete configuration changes when you are next able."
如果关闭窗口,还将关闭正在运行的脚本。您的解决方案是最小化窗口或使用其他编程语言/第三方实用程序隐藏窗口。 – Compo
是不是有办法告诉命令在后台运行而不是前台运行? – mcavanaugh418
不必使用VBscript或第三方程序等其他脚本语言。 – Squashman