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-26 17:39
中国DOS联盟论坛 » 其它操作系统综合讨论区 » What parameter in a batch file represents the currently logged-in user View 726 Replies 1
Original Poster Posted 2006-04-25 15:37 ·  中国 广东 东莞 电信
初级用户
Credits 39
Posts 8
Joined 2006-04-25 10:41
20-year member
UID 54417
Gender Male
From 广东东莞
Status Offline
In Win2k, I want to write a batch file like this: use one parameter to represent the currently logged-in user, and add the current user to the administrators group. Experts, please help, I'm waiting online!
Floor 2 Posted 2006-04-25 16:30 ·  中国 广东 东莞 电信
初级用户
Credits 39
Posts 8
Joined 2006-04-25 10:41
20-year member
UID 54417
Gender Male
From 广东东莞
Status Offline
I already know this now, just use net localgroup administrators %username% /add
But this command can only be used under administrators privileges.
Also, does the batch file itself also have to be run under administrators privileges for it to work?
Forum Jump: