|
yuipr
初级用户
 
积分 52
发帖 25
注册 2007-2-10
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
Originally posted by yuipr at 2007-2-9 04:16 PM:
C:\Documents and Settings\yichuanj>@echo off for /f "tokens=2 delims=*" %a in ('net user ^|find "local"') do @echo %~a
off for /f "tokens=2 delims=*" %a in ('net ...
local的意思是要查询本机的用户组信息,不知道我这是不是写错了,改成任一主机名也行的,高人啊,帮帮我吧,今天必须要结果啊。
Last edited by yuipr on 2007-2-9 at 04:27 PM ]
Originally posted by yuipr at 2007-2-9 04:16 PM:
C:\Documents and Settings\yichuanj>@echo off for /f "tokens=2 delims=*" %a in ('net user ^|find "local"') do @echo %~a
off for /f "tokens=2 delims=*" %a in ('net ...
The word "local" means that it is supposed to query the user group information of the local machine. I don't know if I wrote this wrong. It can be changed to any host name. Oh, expert, help me. I need the result today.
Last edited by yuipr on 2007-2-9 at 04:27 PM ]
|
|
2007-2-10 05:24 |
|
|
yuipr
初级用户
 
积分 52
发帖 25
注册 2007-2-10
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
Originally posted by ccwan at 2007-2-9 04:21 PM:
你的net user 命令执行后输出的内容含有"local"吗?我这里没有哎。所以在我这里代码是不能用的。
有什么可行解决方案呢
Originally posted by ccwan at 2007-2-9 04:21 PM:
Does the output of your net user command contain "local"? I don't have it here. So the code doesn't work for me here.
What are the feasible solutions?
|
|
2007-2-10 05:25 |
|
|
qingfushuan
高级用户
   
积分 502
发帖 327
注册 2006-12-30
状态 离线
|
|
2007-2-10 05:32 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
英文状态“本地组成员”是“Local Group Memberships”
英文CMD下:
for /f "tokens=2 delims=*" %%a in ('net user %username%^|find "Local Group Memberships"') do @echo %%~a
中文CMD下:
for /f "tokens=2 delims=*" %%a in ('net user %username%^|find "本地组成员"') do @echo %%~a
The English state "Local Group Memberships" is "Local Group Memberships"
Under English CMD:
for /f "tokens=2 delims=*" %%a in ('net user %username%^|find "Local Group Memberships"') do @echo %%~a
Under Chinese CMD:
for /f "tokens=2 delims=*" %%a in ('net user %username%^|find "本地组成员"') do @echo %%~a
|
|
2007-2-10 05:36 |
|
|
yuipr
初级用户
 
积分 52
发帖 25
注册 2007-2-10
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
关于这整个批处理你有什么好的建议呢,什么方法能实现我的需求啊
What good suggestions do you have regarding this entire batch processing, and what methods can be used to achieve my requirements?
|
|
2007-2-10 05:36 |
|
|
yuipr
初级用户
 
积分 52
发帖 25
注册 2007-2-10
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
Originally posted by zh159 at 2007-2-9 04:36 PM:
英文状态“本地组成员”是“Local Group Memberships”
英文CMD下:
for /f "tokens=2 delims=*" %%a in ('net user %username%^|find "Local Group Memberships&quo ...
还是不对呢,怪了,难到在你们的机器上能够实现吗?
Originally posted by zh159 at 2007-2-9 04:36 PM:
The English state "Local Group Memberships" is "Local Group Memberships"
In English CMD:
for /f "tokens=2 delims=*" %%a in ('net user %username%^|find "Local Group Memberships&quo ...
Still not right, strange. Could it be that it can be realized on your machines?
|
|
2007-2-10 05:45 |
|
|
yuipr
初级用户
 
积分 52
发帖 25
注册 2007-2-10
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
C:\Documents and Settings\yichuanj>@echo off for /f "tokens=2 delims=*" %a in ('
net user %username%^ |find "Local Group Memberships"') do @echo %~a
FIND: Parameter format not correct
C:\Documents and Settings\yichuanj>@echo off for /f "tokens=2 delims=*" %a in ('
net user %username%^ |find "Local Group Memberships"') do @echo %~a
FIND: Parameter format not correct
|
|
2007-2-10 05:47 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
Originally posted by yuipr at 2007-2-9 16:47:
C:\Documents and Settings\yichuanj>@echo off for /f "tokens=2 delims=*" %a in ('
net user %username%^ |find "Local Group Memberships"') do @echo %~a
FIND: Parameter format ...
兄每次都喜欢把 @echo off 和本应在第二行的命令连成一行一起运行吗?
Originally posted by yuipr at 2007-2-9 16:47:
C:\Documents and Settings\yichuanj>@echo off for /f "tokens=2 delims=*" %a in ('
net user %username%^ |find "Local Group Memberships"') do @echo %~a
FIND: Parameter format ...
Does the brother always like to run @echo off and the command that should be on the second line together in one line?
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2007-2-10 05:59 |
|
|
yuipr
初级用户
 
积分 52
发帖 25
注册 2007-2-10
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
Originally posted by redtek at 2007-2-9 04:59 PM:
兄每次都喜欢把 @echo off 和本应在第二行的命令连成一行一起运行吗?
谢谢提醒:
C:\Documents and Settings\yichuanj>@echo off
for /f "tokens=2 delims=*" %a in ('net user %username%^|find "Local Group Member
ships"') do @echo %~a
The user name could not be found.
More help is available by typing NET HELPMSG 2221.
还是有问题呢,
Originally posted by redtek at 2007-2-9 04:59 PM:
Does the brother always like to run @echo off and the command that should be on the second line in one line together?
Thanks for the reminder:
C:\Documents and Settings\yichuanj>@echo off
for /f "tokens=2 delims=*" %a in ('net user %username%^|find "Local Group Member
ships"') do @echo %~a
The user name could not be found.
More help is available by typing NET HELPMSG 2221.
There is still a problem,
|
|
2007-2-10 06:04 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
建议兄先将 for 去掉,先调试好 net .... 这句。
然后再把 for 加上,否则一层一层怎么错的都不知道,反而加深了调试和解决问题的复杂度:)
如果兄希望一步到位的解决问题,建议如下:
1、兄只执行 net user %username% 这句,然后贴上返回信息,为了方便调试。
2、兄在上面返回信息中标示出你想要什么信息(用颜色标示出来)
3、大家都确认正确以后,再加入 For 和 Find 来操作,这些只是一步的事儿。
Last edited by redtek on 2007-2-9 at 05:07 PM ]
It is suggested that the brother first remove the "for" and debug the "net...." sentence well first.
Then add the "for" back. Otherwise, you won't know how each layer is wrong, which will instead increase the complexity of debugging and solving the problem:)
If the brother hopes to solve the problem in one go, it is suggested as follows:
1、The brother only executes the sentence "net user %username%", and then paste the returned information, for the convenience of debugging.
2、The brother marks out the information you want in the above returned information (marked with colors)
3、After everyone confirms it is correct, then add For and Find to operate. These are just a matter of one step.
Last edited by redtek on 2007-2-9 at 05:07 PM ]
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2007-2-10 06:05 |
|
|
yuipr
初级用户
 
积分 52
发帖 25
注册 2007-2-10
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
Originally posted by redtek at 2007-2-9 05:05 PM:
建议兄先将 for 去掉,先调试好 net .... 这句。
然后再把 for 加上,否则一层一层怎么错的都不知道,反而加深了调试和解决问题的复杂度:)
非常感谢你细致如微的回答。
C:\Documents and Settings\yichuanj>@echo off
net uesr %username%
The syntax of this command is:
NET
我这种调试方法不知道对不对?
Originally posted by redtek at 2007-2-9 05:05 PM:
It is suggested that you first remove the "for" and debug the line "net ...." first.
Then add the "for" back. Otherwise, you won't know where each layer goes wrong, which will only increase the complexity of debugging and problem-solving:)
Thank you very much for your detailed answer.
C:\Documents and Settings\yichuanj>@echo off
net uesr %username%
The syntax of this command is:
NET
I don't know if this debugging method of mine is correct?
|
|
2007-2-10 06:12 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
这是在切换代码页:437 英文状态下的 CMD 输出:
执行命令: net user %username% 所显示的内容:
User name abc
Full Name Abc
Comment
User's comment
Country code 000 (System Default)
Account active Yes
Account expires Never
Password last set 5/26/2005 2:26 PM
Password expires Never
Password changeable 5/26/2005 2:26 PM
Password required Yes
User may change password No
Workstations allowed All
Logon script
User profile
Home directory
Last logon 2/9/2007 7:54 AM
Logon hours allowed All
Local Group Memberships *Administrators *Debugger Users
*Remote Desktop Users *Users
Global Group memberships *None
The command completed successfully.
兄对照一下,想要得到什么?
另:兄在命令行输入
CHCP
输入上面的命令后回车,想看一下兄的 CMD 是默认哪一种代码页,并贴上兄的操做系统版本。
这是在 Windows CMD 中文 936 代码页下执行: net user %username% 命令的输入内容:
用户名 abc
全名 Abc
注释
用户的注释
国家(地区)代码 000 (系统默认值)
帐户启用 Yes
帐户到期 从不
上次设置密码 2005/5/26 下午 02:26
密码到期 从不
密码可更改 2005/5/26 下午 02:26
需要密码 Yes
用户可以更改密码 No
允许的工作站 All
登录脚本
用户配置文件
主目录
上次登录 2007/2/9 上午 07:54
可允许的登录小时数 All
本地组成员 *Administrators *Debugger Users
*Remote Desktop Users *Users
全局组成员 *None
命令成功完成。
This is the CMD output under the code page: 437 in English state when switching code pages:
The content displayed by executing the command: net user %username%:
User name abc
Full Name Abc
Comment
User's comment
Country code 000 (System Default)
Account active Yes
Account expires Never
Password last set 5/26/2005 2:26 PM
Password expires Never
Password changeable 5/26/2005 2:26 PM
Password required Yes
User may change password No
Workstations allowed All
Logon script
User profile
Home directory
Last logon 2/9/2007 7:54 AM
Logon hours allowed All
Local Group Memberships *Administrators *Debugger Users
*Remote Desktop Users *Users
Global Group memberships *None
The command completed successfully.
Brother, compare and see what you want to get?
Also: Brother, enter in the command line
CHCP
After entering the above command and pressing Enter, want to see which code page the brother's CMD is defaulting to, and paste the version of the brother's operating system.
This is the input content of executing the command: net user %username% under the Windows CMD Chinese 936 code page:
User name abc
Full Name Abc
Comment
User's comment
Country/Region code 000 (System default)
Account enabled Yes
Account expires Never
Password last set 5/26/2005 2:26 PM
Password expires Never
Password changeable 5/26/2005 2:26 PM
Password required Yes
User may change password No
Workstations allowed All
Logon script
User profile
Home directory
Last logon 2/9/2007 7:54 AM
Allowed logon hours All
Local group memberships *Administrators *Debugger Users
*Remote Desktop Users *Users
Global group memberships *None
The command completed successfully.
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2007-2-10 06:21 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
另,我没有时间帮兄调试,
只是看着兄没有一次性把自己需要的内容说全,而且兄没有写出在自己机器上单步的执行效果,看着着急,
所以,才写出上面建议:)
如果兄写全了这些信息,给兄解决问题zh159兄和ccwan兄一步就可以帮兄解决掉这问题了:)
所以,建议兄一次写全问题,这样解决者全非常方便一次性解决掉:)
Also, I don't have time to debug for you,
Just seeing that you didn't fully state what you need at one go, and you didn't write out the execution effect of single-stepping on your own machine, which is anxious-making,
So, I just wrote the above suggestions :)
If you fully write out these information, Brother zh159 and Brother ccwan can solve this problem for you in one step :)
So, it's suggested that you fully state the problem at one time, so that the solvers can very conveniently solve it at one go :)
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2007-2-10 06:26 |
|
|
qingfushuan
高级用户
   
积分 502
发帖 327
注册 2006-12-30
状态 离线
|
|
2007-2-10 06:26 |
|
|
yuipr
初级用户
 
积分 52
发帖 25
注册 2007-2-10
状态 离线
|
『第 30 楼』:
使用 LLM 解释/回答一下
非常感谢redtek大哥的再次回答
C:\>chcp
Active code page: 936
我的操作系统是winxp en sp2
我在cmd模式下执行 C:\> net user %username%
The user name could not be found.
More help is available by typing NET HELPMSG 2221.
我和你的代码页应该是一样的,为什么我会提示找不到用户呢?看来就是net user %username%这步有问题。
Last edited by yuipr on 2007-2-9 at 05:33 PM ]
Thanks a lot for brother redtek's answer again.
C:\>chcp
Active code page: 936
My operating system is winxp en sp2.
I execute C:\> net user %username% in cmd mode.
The user name could not be found.
More help is available by typing NET HELPMSG 2221.
My code page should be the same as yours. Why do I get the prompt that the user is not found? It seems that the problem is at the step of net user %username%.
Last edited by yuipr on 2007-2-9 at 05:33 PM ]
|
|
2007-2-10 06:30 |
|