您的位置:首页 > 其它

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: