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-06 01:24
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » I wrote a small program that disables the WIN key when running Warcraft, but it keeps giving errors View 1,250 Replies 5
Original Poster Posted 2007-02-05 07:56 ·  中国 江苏 盐城 建湖县 电信
初级用户
Credits 20
Posts 8
Joined 2007-02-03 04:17
19-year member
UID 78483
Gender Male
Status Offline
I'm a newbie, I just started learning batch files. I wrote a small program that disables the WIN key when running Warcraft (very simple), but it keeps giving errors. As soon as I run it, it says "Too many command-line parameters". Please help me take a look, where is the mistake?
@echo off
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout /v Scancode Map /t REG_BINARY /d 00000000000000000300000000005BE000005CE000000000 /f
Frozen Throne.exe
REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout /v Scancode Map /t REG_BINARY /d /f
I've tried a lot of methods.
Floor 2 Posted 2007-02-05 08:04 ·  中国 吉林 四平 联通
高级用户
★★★
Credits 859
Posts 413
Joined 2006-08-14 21:55
19-year member
UID 60532
Status Offline
Isn't the key value wrong?
Floor 3 Posted 2007-02-05 08:13 ·  中国 江苏 盐城 建湖县 电信
初级用户
Credits 20
Posts 8
Joined 2007-02-03 04:17
19-year member
UID 78483
Gender Male
Status Offline
I learned this key value this afternoon from other computer tutorials, and I wanted to use this to see whether it works. But CMD says this command line itself is written wrong. I want to ask, how can I write these command lines correctly? If the key value is wrong then forget it, or if anyone knows the correct key value, please tell me, I'd be extremely grateful.
Floor 4 Posted 2007-02-05 08:39 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
I'm not familiar with REG, the registry, and that kind of thing, so there's no way I can help you much, brother. Just a small suggestion :)



In the code in post #1, I noticed there is a space here in HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout — there is a space between Keyboard and Layout, right?

Try putting quotes around this kind of content containing spaces when using REG to operate on the registry, to tell REG that this is a single "whole", so REG doesn't mistakenly treat the part after the space as a parameter or some command :)



"HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout"



Is Scancode Map the name of the value? If it's also a single name containing a space in the middle, put quotes around it too, like this: "Scancode Map"

When dealing with directories, filenames, etc. that contain spaces, you should also put them in quotes, so Windows will correctly recognize them as one "whole" instead of some parameter or something else……

[ Last edited by redtek on 2007-2-4 at 07:40 PM ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 5 Posted 2007-02-05 08:54 ·  中国 江苏 盐城 建湖县 电信
初级用户
Credits 20
Posts 8
Joined 2007-02-03 04:17
19-year member
UID 78483
Gender Male
Status Offline
Ah, thank you so much, it's solved. Many thanks, many thanks.
Expert ^_^
Floor 6 Posted 2007-09-28 16:45 ·  中国 江苏 常州 电信
初级用户
Credits 21
Posts 11
Joined 2006-10-20 03:54
19-year member
UID 67151
Status Offline
Seems like it only takes effect after a reboot, right???
Forum Jump: