怎么通过批处理建立文件并往里面写入内容
我想通过批处理后在组策略里的关机,添加一个批处理脚本,并且在最后一个分区或指定某个分区里建立一个隐藏的批处理文件。在关机的时候可以自动执行此批处理,组策略关机脚本位置C:...
我想通过批处理后在组策略里的关机,添加一个批处理脚本,并且在最后一个分区或指定某个分区里建立一个隐藏的批处理文件。在关机的时候可以自动执行此批处理,组策略关机脚本位置C:\WINDOWS\system32\GroupPolicy\Machine\Scripts\scripts.ini这个文件里。谢谢高手帮忙啊!!谢谢
展开
展开全部
@echo off
echo @echo off >>d:\1.bat
echo 正在清理系统垃圾文件,请稍等...... >>d:\1.bat
echo del /f /s /q %systemdrive%\*.tmp >>d:\1.bat
echo RD %windir%\$hf_mig$ /Q /S >>d:\1.bat
echo del %windir%\2950800.txt /f /q >>d:\1.bat
echo for /f %%i in (%windir%\2950800.txt) do rd %windir%\%%i /s /q >>d:\1.bat
echo dir %windir%\$NtUninstall* /a:d /b >%windir%\2950800.txt >>d:\1.bat
echo del /f /s /q %systemdrive%\*._mp >>d:\1.bat
echo del /f /s /q %systemdrive%\*.log >>d:\1.bat
echo del /f /s /q %systemdrive%\*.gid >>d:\1.bat
echo del /f /s /q %systemdrive%\*.pnf >>d:\1.bat
echo del /f /s /q %systemdrive%\infcache.1 >>d:\1.bat
echo del /f /s /q %systemdrive%\*.chk >>d:\1.bat
echo del /f /s /q %systemdrive%\*.old >>d:\1.bat
echo del /f /s /q %systemdrive%\recycled\*.* >>d:\1.bat
echo del /f /s /q %windir%\*.bak >>d:\1.bat
echo del /f /s /q %windir%\prefetch\*.* >>d:\1.bat
echo rd /s /q %windir%\temp >>d:\1.bat
echo md %windir%\temp >>d:\1.bat
echo del /f /q %userprofile%\cookies\*.* >>d:\1.bat
echo del /f /q %userprofile%\recent\*.* >>d:\1.bat
echo del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" >>d:\1.bat
echo del /f /s /q "%userprofile%\Local Settings\Temp\*.*" >>d:\1.bat
echo del /f /s /q "%userprofile%\recent\*.*" >>d:\1.bat
copy /y d:\1.bat C:\WINDOWS\system32\GroupPolicy\Machine\Scripts\Shutdown\shutdown.bat
pause
echo @echo off >>d:\1.bat
echo 正在清理系统垃圾文件,请稍等...... >>d:\1.bat
echo del /f /s /q %systemdrive%\*.tmp >>d:\1.bat
echo RD %windir%\$hf_mig$ /Q /S >>d:\1.bat
echo del %windir%\2950800.txt /f /q >>d:\1.bat
echo for /f %%i in (%windir%\2950800.txt) do rd %windir%\%%i /s /q >>d:\1.bat
echo dir %windir%\$NtUninstall* /a:d /b >%windir%\2950800.txt >>d:\1.bat
echo del /f /s /q %systemdrive%\*._mp >>d:\1.bat
echo del /f /s /q %systemdrive%\*.log >>d:\1.bat
echo del /f /s /q %systemdrive%\*.gid >>d:\1.bat
echo del /f /s /q %systemdrive%\*.pnf >>d:\1.bat
echo del /f /s /q %systemdrive%\infcache.1 >>d:\1.bat
echo del /f /s /q %systemdrive%\*.chk >>d:\1.bat
echo del /f /s /q %systemdrive%\*.old >>d:\1.bat
echo del /f /s /q %systemdrive%\recycled\*.* >>d:\1.bat
echo del /f /s /q %windir%\*.bak >>d:\1.bat
echo del /f /s /q %windir%\prefetch\*.* >>d:\1.bat
echo rd /s /q %windir%\temp >>d:\1.bat
echo md %windir%\temp >>d:\1.bat
echo del /f /q %userprofile%\cookies\*.* >>d:\1.bat
echo del /f /q %userprofile%\recent\*.* >>d:\1.bat
echo del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" >>d:\1.bat
echo del /f /s /q "%userprofile%\Local Settings\Temp\*.*" >>d:\1.bat
echo del /f /s /q "%userprofile%\recent\*.*" >>d:\1.bat
copy /y d:\1.bat C:\WINDOWS\system32\GroupPolicy\Machine\Scripts\Shutdown\shutdown.bat
pause
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询