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-08-04 05:42
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to use a variable for the current username View 639 Replies 3
Original Poster Posted 2007-04-18 03:39 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
20-year member
UID 58334
Gender Male
Status Offline
For example, use %SystemRoot% to represent the current C:\windows

Then how do you represent the current username?

I want to copy cc.exe to
C:\Documents and Settings\xx\SendTo

If I don't know what this XX username is, how should I write it?
Floor 2 Posted 2007-04-18 04:07 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Floor 3 Posted 2007-04-18 04:23 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 866
Posts 415
Joined 2005-12-04 11:19
20-year member
UID 46459
Status Offline
Or "C:\Documents and Settings\%username%\SendTo"
Floor 4 Posted 2007-04-18 04:24 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Forum Jump: