knkty
Enthusiast
Enthusiast

Hi again,

Followed your suggestion. It seems it is completely about timing. 3 secs break fixed the problem.

created a shortcut(startup)and used the batch file i have created before for testing when trying to set logon task and triggered task. It worked as a startup batch file.

Like you said users see a command windows for 3 secs but it is better than setting the default printer every day.

What i did;

Created a logoff task that calls defaultprinterexport.bat

defaultprinterexport.bat

@echo off

reg export "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" \\servername\uemuserprofiles\%username%\defaultprinter.reg /y

Above command exports the default printer in to the user profile folder and overrides the file every logoff bc sometimes users change the default printer when they move to another desk.

created a shortcut (startup) defaultprinterimport.bat

defaultprinterimport.bat

@echo off

timeout 3 /nobreak

reg import \\servername\uemuserprofiles\%username%\defaultprinter.reg

Thanks again