Arlen Holder
2020-04-16 17:48:48 UTC
What specific method do you prefer for running a batch file silently
[sans a command window displaying]?
The question isn't whether it can be done, but which of the many methods do
you find most useful when you need to schedule a command to run silently.
The number & variation of potential freeware solutions are vast, e.g.,
o <https://serverfault.com/questions/9038/run-a-bat-file-in-a-scheduled-task-without-a-window>
o <https://www.raymond.cc/blog/hidden-start-runs-batch-files-silently-without-flickering-console/>
o <https://www.winhelponline.com/blog/run-bat-files-invisibly-without-displaying-command-prompt/>
etc.
Note the surprisingly many freeware solutions suggested in those threads.
I'm sure most of those freeware solutions will work, so this thread is
simply a quick question asking those of you who _already_ many times
implemented scheduling of batch commands to run silently...
.... *which method do you most prefer?* ....
There is only one user & I've already scheduled the batch command.
o But it pops up a window which I want to not be visible all the time.
Start > Run > taskschd.msc >
Create Basic Task >
Name = tzrandom
Description = Schedule random Windows system timzone changes
Trigger: (o)When I log on
Action: Start a program > C:\app\os\pgm\bat\tzrandom.bat
In summary, this question asks experienced users who have already many
times scheduled a freeware batch command to run silently in Windows...
*Q: Which silent mode batch scheduling method do you most prefer?*
--
For reference, this is the randomizer I wish to run silently.
@echo off
rem tzrandom.bat randomly sets the Windows system timezone
rem by Herbert Kleebauer, 20200415, alt.msdos.batch
setlocal EnableDelayedExpansion
:loop
set /a n=137*%random%/32768*3+1
for /f "tokens=*" %%i in ('tzutil /l^|more +%n%') do set a=%%i& goto :l1
:l1
echo.
echo.
echo setting time zone to: %a%
tzutil.exe /s "%a%"
:: wait 6-24h
set /a n=20864+(%random%*2)
set /a h=%n%/3600
set /a m=(n-(%h%*3600))/60
echo waiting %h% hours, %m% minutes
timeout %n%
goto :loop
exit 0
[sans a command window displaying]?
The question isn't whether it can be done, but which of the many methods do
you find most useful when you need to schedule a command to run silently.
The number & variation of potential freeware solutions are vast, e.g.,
o <https://serverfault.com/questions/9038/run-a-bat-file-in-a-scheduled-task-without-a-window>
o <https://www.raymond.cc/blog/hidden-start-runs-batch-files-silently-without-flickering-console/>
o <https://www.winhelponline.com/blog/run-bat-files-invisibly-without-displaying-command-prompt/>
etc.
Note the surprisingly many freeware solutions suggested in those threads.
I'm sure most of those freeware solutions will work, so this thread is
simply a quick question asking those of you who _already_ many times
implemented scheduling of batch commands to run silently...
.... *which method do you most prefer?* ....
There is only one user & I've already scheduled the batch command.
o But it pops up a window which I want to not be visible all the time.
Start > Run > taskschd.msc >
Create Basic Task >
Name = tzrandom
Description = Schedule random Windows system timzone changes
Trigger: (o)When I log on
Action: Start a program > C:\app\os\pgm\bat\tzrandom.bat
In summary, this question asks experienced users who have already many
times scheduled a freeware batch command to run silently in Windows...
*Q: Which silent mode batch scheduling method do you most prefer?*
--
For reference, this is the randomizer I wish to run silently.
@echo off
rem tzrandom.bat randomly sets the Windows system timezone
rem by Herbert Kleebauer, 20200415, alt.msdos.batch
setlocal EnableDelayedExpansion
:loop
set /a n=137*%random%/32768*3+1
for /f "tokens=*" %%i in ('tzutil /l^|more +%n%') do set a=%%i& goto :l1
:l1
echo.
echo.
echo setting time zone to: %a%
tzutil.exe /s "%a%"
:: wait 6-24h
set /a n=20864+(%random%*2)
set /a h=%n%/3600
set /a m=(n-(%h%*3600))/60
echo waiting %h% hours, %m% minutes
timeout %n%
goto :loop
exit 0