中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-13 23:08
47,812 topics / 349,916 posts / today 0 new / 48,268 members
其它操作系统综合讨论区 » [fixed] How to display a string containing &?
Printable Version  1,575 / 14
Floor1 chishingchan Posted 2009-02-10 12:43
银牌会员 Posts 538 Credits 1,284
Please look at this example:



! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kbdclass\Enum
1 REG_SZ ACPI\PNP0303\4&30647147&0

Press any key to continue . . .





! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kbdclass\Enum
1 REG_SZ ACPI\PNP0303\4&30647147&0

ACPI\PNP0303\4
'30647147' is not recognized as an internal or external command,
operable program or batch file.
'0' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .


How can I fix this error? Thanks!



———————————————————————
Moved from DOS Troubleshooting & Problem Discussion (Answer Room)
Obviously posted in the wrong section, points deducted accordingly.
——Administrator
———————————————————————


[ Last edited by chishingchan on 2009-2-12 at 01:26 ]
Floor2 chishingchan Posted 2009-02-10 20:06
银牌会员 Posts 538 Credits 1,284
Can't be helped, the forum categories seem a bit vague, since my question involves both DOS batch files and the Windows registry. It doesn't matter if points are deducted, take it as a lesson, but what I most hope for is that the problem can be solved.
Floor3 DOSroot Posted 2009-02-10 20:44
管理员 Posts 198 Credits 389
It's all right. If I deducted points by mistake I can add them back to you.

Let's discuss what category your problem falls under. It's true that sometimes I also feel confused when using a DOS method to solve a Windows problem—is this a DOS problem or a Windows problem? But in your case I really can't see what it has to do with DOS.

If you want to solve similar problems with batch files in the future, you can post them in the "Batch File Room".
Floor4 chishingchan Posted 2009-02-10 22:01
银牌会员 Posts 538 Credits 1,284
How should I put it? This is the discussion area, so it also seems reasonable for my question to be in 《DOSTroubleshooting & Problem Discussion (Answer Room) 》. Anyway, this isn't important. It doesn't matter if points were deducted. Could the administrator help solve this problem?


Also, do CMD commands belong to Windows or to DOS?]]>

[ Last edited by chishingchan on 2009-2-10 at 22:05 ]
Floor5 DOSroot Posted 2009-02-10 22:39
管理员 Posts 198 Credits 389
Originally posted by chishingchan at 2009-2-10 22:01:

Also, do CMD commands belong to Windows or to DOS?


As someone who registered around the time the forum was founded, and who has already reached the "Silver Member" level, seeing you ask a question like this really leaves me surprised.

I assume you must know willsort. If you're not clear on this concept, please take a look at his post:

http://www.cn-dos.net/forum/viewthread.php?tid=20682

Just read the first paragraph.
Floor6 chishingchan Posted 2009-02-11 01:49
银牌会员 Posts 538 Credits 1,284
This article is written so well, just like the way he describes his own software. It's the first time I've come across it, and I've learned from it.
I registered in 2002, and Silver Member is actually not much. Earlier, because I forgot my password, I even registered another account called chishing. I forgot what rank that one was. Also, I'm not very active on this forum. I only think of coming here when I run into difficulties. Honestly speaking, the knowledge I've learned from this forum has helped me a great deal, and I also thank the enthusiastic moderators for answering my questions, thank you!
Actually, many of the forum's veteran members are probably like me, dropping by here from time to time whenever they go online, because sometimes the posts I reply to and the difficult questions I raise also take a long time before anyone responds.
I also admit I'm getting a bit older. It's not like I can use many commands or techniques whenever I want; I have to look at examples before I can write a program, just like flipping through a book during an open-book exam. Besides, DOS is only auxiliary for me. If I come up with a piece of software, could I really just know DOS and then write a program to sell? DOS can't do that.
Right now I'm also learning VBS. After all, under Windows its auxiliary value is greater than DOS's, and I've had a little success with it, but I still have to look things up before writing, because I can't remember it all.
I've said too much...

Back to the main topic, could the administrator help with the question in the top post?
Floor7 HAT Posted 2009-02-11 05:18
版主 Posts 5,017 Credits 9,023
Floor8 chishingchan Posted 2009-02-11 09:05
银牌会员 Posts 538 Credits 1,284
Thanks to moderator HAT for the answer, but it still doesn't quite work, because the obtained value still has another use.


! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kbdclass\Enum
1 REG_SZ ACPI\PNP0303\4&30647147&0

"ACPI\PNP0303\4&30647147&0"
Press any key to continue . . .


Use the retrieved variable as part of a parameter and add a multi-string value:


Error: Invalid key name
Press any key to continue . . .


[ Last edited by chishingchan on 2009-2-11 at 09:24 ]
Floor9 HAT Posted 2009-02-11 13:08
版主 Posts 5,017 Credits 9,023
Floor10 chishingchan Posted 2009-02-11 13:12
银牌会员 Posts 538 Credits 1,284
Originally posted by HAT at 2009-2-11 01:08 PM:
Floor11 HAT Posted 2009-02-11 20:53
版主 Posts 5,017 Credits 9,023
Yes, by default everyone has read permission on that branch. You can use the regini command to modify its permissions.
Floor12 chishingchan Posted 2009-02-11 22:05
银牌会员 Posts 538 Credits 1,284
Originally posted by HAT at 2009-2-11 08:53 PM:
Yes, by default everyone has read permission on that branch. You can use the regini command to modify its permissions.


When I run regini directly nothing happens, and /? also gives no response. How do I modify the permissions?
Floor13 HAT Posted 2009-02-11 22:15
版主 Posts 5,017 Credits 9,023
Floor14 chishingchan Posted 2009-02-12 01:14
银牌会员 Posts 538 Credits 1,284
Floor15 netbenton Posted 2009-02-13 02:38
银牌会员 Posts 752 Credits 1,916 From 广西
@echo off
REG QUERY "HKLM\SYSTEM\CurrentControlSet\Services\Kbdclass\Enum" /v 1
for /f "tokens=3" %%a in ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Services\Kbdclass\Enum" /v 1 ^|findstr "REG_SZ"') do @set K1=%%a
echo %K1%
pause


As for the problem in the first post,
it seems this can also display normally:

@echo off&setlocal enabledelayedexpansion
REG QUERY "HKLM\SYSTEM\CurrentControlSet\Services\Kbdclass\Enum" /v 1
for /f "tokens=3" %%a in ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Services\Kbdclass\Enum" /v 1 ^|findstr "REG_SZ"') do @set “K1=%%a”
echo !K1!
pause
endlocal
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023