Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 5,226 Posts 1,737 Joined 2006-03-10 00:38 20-year member UID 51697 From 成都
Status Offline
Under XP I made an at task to call test.bat and run it in the background. One line in test.bat is echo %username%>>D:\list.txt. After test.bat runs at the scheduled time, the current logged-in username does not appear in list.txt, and instead it shows
"ECHO is off."
If I run test.bat by itself, it displays correctly. What is going on?
Credits 1,276 Posts 469 Joined 2002-12-23 13:00 23-year member UID 586 Gender Male From 福建泉州
Status Offline
The at command uses the SYSTEM account,
which does not have the %username% variable.
You can use at xx:xx /interactive cmd
to start cmd,
then use set to check.