China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

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!

中国DOS联盟论坛
The time now is 2026-07-31 19:14
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » Why can't %username% be displayed in the at command View 1,348 Replies 1
Original Poster Posted 2006-04-22 23:12 ·  中国 四川 成都 鹏博士宽带
荣誉版主
★★★★
batch fan
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?

[ Last edited by namejm on 2006-4-22 at 23:41 ]
Floor 2 Posted 2006-04-23 09:10 ·  中国 福建 泉州 电信
银牌会员
★★★
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.
QQ:366840202
http://chenall.net
Forum Jump: