CMD 共享盘符给administrator BAT脚本
2012-09-15 17:27
197 查看
@echo Off
set user_pwd=123
ipconfig /renew >nul
if %errorlevel% EQU 0 (
setlocal enabledelayedexpansion
FOR /F %%a in ('mountvol ^|find ":\"') do (
set mtvdrv=%%a
set mtvdrv=!mtvdrv::\=!
net share !mtvdrv!$=!mtvdrv!: /GRANT:administrator,FULL > nul
if %errorlevel% NEQ 0 (
echo the "!mtvdrv!" Paration share failed.
) else (
echo the "!mtvdrv!" Paration share succeed.
)
)
endlocal
)
net user administrator %user_pwd% > nul
if %errorlevel% NEQ 0 (
echo The user password of Administrator user change failed.
) else (
echo The user password of Administrator user change succeed, The password is %user_pwd%.
)
pause
set user_pwd=123
ipconfig /renew >nul
if %errorlevel% EQU 0 (
setlocal enabledelayedexpansion
FOR /F %%a in ('mountvol ^|find ":\"') do (
set mtvdrv=%%a
set mtvdrv=!mtvdrv::\=!
net share !mtvdrv!$=!mtvdrv!: /GRANT:administrator,FULL > nul
if %errorlevel% NEQ 0 (
echo the "!mtvdrv!" Paration share failed.
) else (
echo the "!mtvdrv!" Paration share succeed.
)
)
endlocal
)
net user administrator %user_pwd% > nul
if %errorlevel% NEQ 0 (
echo The user password of Administrator user change failed.
) else (
echo The user password of Administrator user change succeed, The password is %user_pwd%.
)
pause
相关文章推荐
- window批处理脚本学习使用:.bat .cmd文件编写
- bat+sqlcmd 批量运行脚本
- bat+sqlcmd 批量执行脚本
- [转载]Bat CMD 批处理文件脚本总结(英文)
- bat脚本 cmd 命令
- 自动清除电脑垃圾及删除windows默认共享盘符的批处理bat
- CMD命令之BAT脚本路径信息
- BAT CMD 批处理文件脚本总结
- windows7设置wifi热点BAT脚本和共享方法分享
- 关于Bat脚本之间变量共享的若干问题
- Windows bat脚本获取administrator权限
- BAT CMD 批处理文件脚本总结(中文)
- CMD命令之BAT脚本语法详解
- 修改 cmd的属性(字体,颜色等),加入ls命令(编写一个bat脚本)。
- Windows bat脚本获取administrator权限
- cmd下用bat文件执行adb 脚本命令
- Windows系统自动连接网络共享打印机BAT脚本分享
- BAT CMD 批处理文件脚本 -2
- windows:subst 映射文件夹为盘符塈设置开机启动执行bat脚本
- BAT CMD 批处理文件脚本总结