For about the last 20 years I've had a batch file that runs when th computer starts, and it logs the start time. But now, with Win 10,
a)
I can't get it to run on startup. I had great difficulty in creating an Autoexec.bat - and when I did, it doesn't work ! And I am also blocked from accessing my User's Start folder; and
b)
the .bat file doesn't work when I run it, but when I paste the commands into a DOS window, they each work fine !
Here are the relevant lines:-
rem ==============[ StartUp ]============
:StartUp
echo on
H:
CD H:\Belfry
path %path;H:/Belfry
REM -----------[ Start log process ]------------------
Copy C:\WINDOWS\WindowsUpdate.log StartUp /Y
dir StartUp > Scrap.txt
Find /I "StartUp" < Scrap.txt >> Use-Log.txt
REM -----------[ End log process ]----------------------------------------------------
pause
Exit
It appears that "it" doesn't recognise the FIND command in a Batch file, but will as a direct command.
Win 10 Startup Batchfile doesn't work
Moderator: DosItHelp
Re: Win 10 Startup Batchfile doesn't work
use SCHTASKS:
or
though to create the task you'll need a console session with admin privileges.
Code: Select all
SCHTASKS /Create /SC ONLOGON /TN TASK_NAME /TR "C:\some.bat" /RU %USERNAME% /F /RL HIGHEST
Code: Select all
SCHTASKS /Create /SC ONSTART /TN TASK_NAME /TR "C:\some.bat" /RU %USERNAME% /F /RL HIGHEST