Hi Every one ,
Can any one please post a .bat file which restarts machine on every friday around 9:00PM
Thanks,
Santosh kumar
Restart machine on every friday arount 12:00PM
Moderator: DosItHelp
-
- Posts: 32
- Joined: 08 Jul 2011 03:38
Re: Restart machine on every friday arount 12:00PM
Code: Select all
setlocal enableextensions
set "dayX=Fr" &set "hourX=21"
:day
>today.vbs echo.WScript.Echo WeekDayName(Weekday(Now),True)
for /f %%a in ('cscript /nologo today.vbs') do set "today=%%a"
if not "%today%"=="%dayX%" (ping -n 3333 localhost >nul &goto :day)
set /p last=< lastdate.log
if "%date%"=="%last%" (ping -n 99999 localhost >nul &goto :day)
:hour
if not "%time:~-0,2%"=="%hourX%" (ping -n 333 localhost >nul &goto :hour)
echo %date%> lastdate.log
shutdown -r
Re: Restart machine on every friday arount 12:00PM
'
Code: Select all
set "?=1sthMonth.CMD" &set /p "?= :/ !?! "<nul
::(
at 00:00 /interactive /every:1 "!FullPath.SOURCE!\!?!"
::)
set "?=Saturday.CMD" &set /p "?= :/ !?! "<nul
::(
at 00:00 /interactive /every:za "!FullPath.SOURCE!\!?!"
::)
-
- Posts: 32
- Joined: 08 Jul 2011 03:38
Re: Restart machine on every friday arount 12:00PM
Hi The first code works perfectly .
I have not tested Edward code . but i think it will work.
Thanks a lot for your help guys ..
Thanks,
San
I have not tested Edward code . but i think it will work.
Thanks a lot for your help guys ..
Thanks,
San
-
- Posts: 32
- Joined: 08 Jul 2011 03:38
Re: Restart machine on every friday arount 12:00PM
HI FOlks,
Adding one more query. Can the bat file run automatically on every friday around 13:00pm to shut down the machine.
Note: I know we can call the bat file from a scheduler in the control panel a part from that ..
Awaiting for your reply.
Thanks,
San
Adding one more query. Can the bat file run automatically on every friday around 13:00pm to shut down the machine.
Note: I know we can call the bat file from a scheduler in the control panel a part from that ..
Awaiting for your reply.
Thanks,
San