windows bat
目录
- windows bat
- netsh2-ipv4
- 新建文件夹
- Windows 10 右下角时间显示时分秒
- windows route
- 检测到以管理员权限运行
- 系统自动登录cmd命令
- 删除RunMRU【运行记录】
netsh2-ipv4
Windows设置IP地址的bat脚本
@echo off
title netsh2-ipv4
:nc
rem //选择网卡
echo --请根据网卡名选择网卡:
echo ex 、退出(exit)
echo 01 、以太网(win8\win10)
echo 02 、本地连接(win xp\win7)
echo 03 、WLAN
echo 04 、Enternet
echo 05 、Local Area Connection
echo.
echo --请选择后回车:
set /p netname=
if %netname%==ex exit
if %netname%==01 set NAME="以太网"
if %netname%==02 set NAME="本地连接"
if %netname%==03 set NAME="WLAN"
if %netname%==04 set NAME="Enternet"
if %netname%==05 set NAME="Local Area Connection"
echo 您选择的网卡是%NAME%
echo.
rem //选择要设置的IP地址:
:list
echo ---选择要设置的IP地址:
echo nc 、返回重新选择网卡(back)
echo ex 、退出(exit)
echo 01 、从DHCP自动获取IP地址
echo 02 、IP:192.168.90.8
echo.
echo ---请选择后回车:
set /p operate=
if %operate%==nc goto nc
if %operate%==ex exit
if %operate%==01 goto dhcp
if %operate%==02 goto 02
echo.
rem //设置IP地址
:dhcp
echo 正在设置动态IP,请稍等...
echo 正在从DHCP自动获取IP地址...
netsh interface ip set address %NAME% dhcp
echo 正在从DHCP自动获取DNS地址...
netsh interface ip set dns %NAME% dhcp
echo %NAME%地址已自动获取成功!
pause & exit
:02
rem //可以根据你的需要更改
set ADDR=192.168.90.8
set MASK=255.255.255.0
set GATEWAY=192.168.90.1
set DNS1=114.114.114.114
set DNS2=8.8.8.8
echo 正在设置%NAME% IP地址,请稍等...
rem //设置并打印在屏幕上
echo IP地址 = %ADDR%
echo 掩码 = %MASK%
echo 网关 = %GATEWAY%
netsh interface ipv4 set address %NAME% static %ADDR% %MASK% %GATEWAY%
echo 首选DNS = %DNS1%
netsh interface ipv4 set dns %NAME% static %DNS1%
echo 备用DNS = %DNS2%
if "%DNS2%"=="" (echo DNS2为空) else (netsh interface ipv4 add dns %NAME% %DNS2%)
echo %NAME% IP已设置完成!
pause & exit
新建文件夹
@echo off
set /p BankName="请输入银行名称:"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\亚晨\\Config"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\巡检报告"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\设备信息表"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\报警\\DB"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\对讲\\DB"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\门禁\\DB"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\计算机资产\\服务器"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\计算机资产\\桌面机"
md "%date:~0,4%%date:~5,2%%date:~8,2%-%BankName%\\iVMS8100\\DB"
rem pause & exit
exit
Windows 10 右下角时间显示时分秒
新建文本文档,并命名为“timeHmS.reg”
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"ShowSecondsInSystemClock"=dword:00000001
windows route
- 查询路由命令
route print
- 添加路由命令
route -p add 5.48.25.0 mask 255.255.255.240 5.48.25.14
- 删除路由命令
route delete 5.48.25.0
检测到以管理员权限运行
@echo off
echo OFF
NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
ECHO Administrator PRIVILEGES Detected!
ECHO 检测到以管理员权限运行!
) ELSE (
echo.
echo.
echo ####### ERROR: ADMINISTRATOR PRIVILEGES REQUIRED #########
echo ####### ERROR: 需要以管理员权限运行 #########
echo This script must be run as administrator to work properly!
echo If you're seeing this after clicking on a start menu icon, then right click on the shortcut and select "Run As Administrator".
echo 这个批处理脚本需要管理员权限才能正常运行!
echo 请右键该菜单或批处理文件,选择"以管理员身份运行".
echo ##########################################################
echo.
PAUSE
EXIT /B 1
)
系统自动登录cmd命令
control userpasswords2
删除RunMRU【运行记录】
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU\" /f