远程开默认共享

来源:互联网 发布:如何更改淘宝账号名 编辑:程序博客网 时间:2024/06/05 12:44

远程开默认共享

@echo off

echo 探测远程主机中. . .

set /p cm=comupter name [local machine]:

ping %cm%

cls

echo 请输入用户名及密码. . .

set user=ln-tf\liaobin

set /p user=user name [ln-tf\liaobin]:

set pwd=Aa123456

set /p pwd=password [Aa123456]:

cls

echo 任务计划服务开启中. . .

net use \\%cm%\ipc$ %pwd% /user:%user%

sc \\%cm% config Schedule start= demand

sc \\%cm% start Schedule

echo 正在探测远程主机时间. . .

for /f "tokens=1,2 delims=:" %%i in ("%time%") do set /a hh1=%%i & set /a mm1=%%j

net time \\%cm% /set /y

for /f "tokens=1,2 delims=:" %%i in ("%time%") do set /a hh=%%i & set /a mm=%%j

echo 远程主机:%cm%上的时间为%hh%:%mm%

set /a mm=%mm%+1

at \\%cm% %hh%:%mm% net share c$=c:

at \\%cm% %hh%:%mm% net share d$=d:

at \\%cm% %hh%:%mm% net share e$=e:

at \\%cm% %hh%:%mm% net share Admin$=%systemroot%

echo 共享将在一分钟后启动....

time %hh1%:%mm1%

pause

0 0