w10install/scripts/install-logonscript.cmd

29 lines
671 B
Batchfile
Raw Normal View History

2021-01-10 15:49:37 +01:00
@echo off
set SOURCE=deploy/logon.cmd
2021-01-10 16:42:07 +01:00
set TOOLS=c:\tools
2021-01-10 15:49:37 +01:00
set TARGET="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup"
echo ####### %0 #######
2021-01-10 16:42:07 +01:00
rem cleanup ...
2021-01-10 15:49:37 +01:00
del /Q /F %TARGET%\logon* 1>nul 2>nul
2021-01-10 16:42:07 +01:00
del /Q /F %TOOLS%\logon.cmd 1>nul 2>nul
echo copy logon.cmd to %TOOLS% ...
copy /Y %SOURCE% %TOOLS%
echo create link for logon script...
mklink %TARGET%\logon.cmd %TOOLS%\logon.cmd
2021-01-10 15:49:37 +01:00
echo create link on desktop...
del /Q /F "%USERPROFILE%\Desktop\Autostart*" 1>nul 2>nul
rmdir /Q "%USERPROFILE%\Desktop\Autostart" 1>nul 2>nul
mklink /D "%USERPROFILE%\Desktop\Autostart" %TARGET%
echo execute logon script...
call %TARGET%\logon.cmd
echo ####### %0 #######