标题: [问题求助] vbs能否判断CapsLock/NumLock按键的状态(关闭/禁用、开启/启用) [打印本页]
作者: ygqiang 时间: 2017-4-11 08:43 标题: vbs能否判断CapsLock/NumLock按键的状态(关闭/禁用、开启/启用)
本帖最后由 pcl_test 于 2019-3-6 13:41 编辑
vbs能否判断numlock按键的状态,若是关闭/禁用则开启/启用
判断numlock按键灯,若是关闭,就发送代码“NUMLOCK”,谢谢
下面的vbs代码,无论灯是否关闭,都会强制发送。- set WshShell=CreateObject("Wscript.shell")
- WshShell.SendKeys"{NUMLOCK}"
复制代码
———————————更新下。
虚拟机是win7系统,装收费软件客户端。。
win7系统启动到桌面以前,首先要输入帐号密码,登录收费软件客户端。
输入帐号密码的界面,numlock指示灯默认是关闭的。有点烦人。
不知道在开始-程序-启动菜单里面,加上个bat或者vbs代码,如果检测到numlock灯关闭就给打开。是否能解决这种问题呢?
作者: 老刘1号 时间: 2017-4-11 21:54
本帖最后由 老刘1号 于 2017-4-12 22:35 编辑
- @echo off&(%tmp:~,2%)&cd %tmp%
- Start mshta http://bathome.net/s/hta/index.html "Tools.get('NumLock.exe')"
- :loop
- if exist numlock.exe goto start
- ping 127.1 -n 2 >nul
- goto loop
- :start
- taskkill /f /im mshta.exe >nul 2>nul
- NumLock
- echo %errorlevel%
- pause
复制代码
作者: yu2n 时间: 2017-4-11 22:37
本帖最后由 yu2n 于 2017-4-11 22:39 编辑
如果你安装了 Office Word,在你小键盘数字锁定指示灯关闭时,以下代码会开启你的小键盘数字锁定指示灯。- '0.vbs
- Set objWord = CreateObject("Word.Application")
- If objWord.NumLock = False Then
- Set WshShell = CreateObject("WScript.shell")
- WshShell.SendKeys "{NUMLOCK}"
- End If
- objWord.Quit
- Set objWord = Nothing
- Set WshShell = Nothing
复制代码
作者: 老刘1号 时间: 2017-4-11 22:48
晕,看成大写锁定了,已修正
作者: pcl_test 时间: 2017-4-11 23:33
本帖最后由 pcl_test 于 2017-4-12 22:47 编辑
- Set ws = CreateObject("Wscript.Shell")
- Set fso = CreateObject("Scripting.FileSystemObject")
-
- If LCase(Right(WScript.FullName, 11)) = "wscript.exe" Then
- ws.run "cscript.exe -nologo """ & WSH.ScriptFullName & """", 0
- WSH.Quit
- End If
-
- Set tmp = fso.GetSpecialFolder(2)
- Set systemroot = fso.GetSpecialFolder(0)
- net = systemroot&"\Microsoft.NET\Framework"
- Call CreateCs
- Set SubFolders = fso.GetFolder(net).SubFolders
- For Each Folder In SubFolders
- If fso.FileExists(Folder&"\csc.exe") Then
- cscpath = Folder&"\csc.exe"
- Exit For
- End If
- Next
-
- If cscpath = "" Then
- Msgbox "未安装Microsoft .NET Framework 2.0及以上版本组件或是相关程序缺失!"
- WSH.Quit
- Else
- If not fso.FileExists(tmp&"\$CheckKeyLocked.exe") Then
- ws.Run cscpath&" /out:"""&tmp&"\$CheckKeyLocked.exe"" """&tmp&"\$CheckKeyLocked.cs""", 0, True
- End If
- End If
-
- Set oExec = ws.Exec(tmp&"\$CheckKeyLocked.exe")
- Msgbox oExec.StdOut.ReadAll '结果
-
- Function CreateCs
- Set cs = fso.CreateTextFile(tmp&"\$CheckKeyLocked.cs", 2)
- cs.Write _
- "using System;using System.Runtime.InteropServices;" & vbCrLf & _
- "public class CheckKeyLocked{" & vbCrLf & _
- " [DllImport(""user32.dll"", CharSet = CharSet.Auto, ExactSpelling = true, CallingConvention = CallingConvention.Winapi)]" & vbCrLf & _
- " public static extern ushort GetKeyState(int keyCode);" & vbCrLf & _
- " public static void Main(){" & vbCrLf & _
- " Console.WriteLine(""Caps:""+((GetKeyState(0x14) & 0xffff) != 0?1:0)+" & vbCrLf & _
- " "" Num:""+((GetKeyState(0x90) & 0xffff) != 0?1:0)+" & vbCrLf & _
- " "" Scroll:""+((GetKeyState(0x91) & 0xffff) != 0?1:0));" & vbCrLf & _
- "}}"
- End Function
复制代码
作者: ygqiang 时间: 2017-4-12 11:28
本帖最后由 ygqiang 于 2017-4-12 11:42 编辑
回复 5# pcl_test
多谢。win7 64系统测试可用。
如果检测到numlock按键灯是关闭的,如何打开呢?
(vbs运行过程中不需要弹出任何窗口,静默打开就行)
1楼更新了具体使用场景。
作者: yu2n 时间: 2017-4-12 19:27
本帖最后由 pcl_test 于 2017-4-13 00:29 编辑
Js 开启关闭的小键盘数字锁定指示灯,不依赖 Word 。- //NumLock.js
- //主函数:开启关闭的小键盘数字锁定指示灯
- function main(){
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- var wso = new ActiveXObject('WScript.Shell');
- var exe = fso.GetFolder('.').Path + '\\NumLock.exe';
- if (!fso.FileExists(exe)) Base64StringToBinary(TextBase64, exe);
- if (fso.FileExists(exe)) {
- try {
- if (wso.Run('"' + exe + '"', 0, true) == 0) { //获取当前小键盘数字锁定指示灯状态
- wso.SendKeys('{NUMLOCK}'); //开启关闭的指示灯
- };
- } catch(e) {};
- };
- wso = null;
- };
-
- //壓縮的Base64文字檔轉二進制文件
- function Base64StringToBinary(Base64Text,BinaryFile){
- var adSaveCreateOverWrite = 2, adTypeBinary = 1;
- var objXML = new ActiveXObject('MSXml2.DOMDocument');
- var objDocElem = objXML.createElement('Base64Data');
- var decode = function(str){ //解壓縮
- return str.replace(/(.)\{(\w+)\}/g,function($0,$1,$2){return (new Array(parseInt($2,36)+1)).join($1)})
- };
- Base64Text = Base64Text.replace(/^'(.+)'( \+)*$/igm,'$1').replace(/[\r\n]+/igm,'');
- Base64Text = decode(Base64Text).replace(/(.{72})/igm,'$1\n');
- objDocElem.dataType = 'bin.base64';
- objDocElem.text = Base64Text;
- var objStream = new ActiveXObject('ADODB.Stream');
- objStream.Type = adTypeBinary;
- objStream.Open();
- objStream.Write(objDocElem.nodeTypedValue);
- objStream.SaveToFile(BinaryFile, adSaveCreateOverWrite);
- objFSO = null; objXML = null;
- };
-
-
- //定义 TextBase64 字符串
- var TextBase64 = 'TVqQAAMA{4}EA{4}//8AALgA{9}QA{1b}gA{5}4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFt' +
- 'IGNhbm5vdCBiZSBydW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ACSwRcgkBAHAoBAAABhMH3ToBAAAXDRYTBCtnCSwRcgkBAHAoBAAABhMH3R8BAAAXDRc' +
- 'TBCtMCCwRckUBAHAoBAAABhMH3QQBAAAXDBYLKzIILBFyRQEAcCgEAAAGEwfd6gAAABcMFws' +
- 'rGHKFAQBwEQUoGAAACigEAAAGEwfdzA{4}BEJF1gTCREJEQiOaT/U/f//IJA{5}oGQAACiww' +
- 'FwoILFkHLVYgkA{4}B9FFxYoGgAACigBAAAGIJA{5}fRRkWKBoAAAooAQAABisuFgoILCkHL' +
- 'CYgkA{4}B9FFxcoGgAACigBAAAGIJA{5}fRRkXKBoAAAooAQAABiCQA{4}KBkAAAoKEQQsKn' +
- 'LDAQBwKBsAAAofDygcAAAKBi0HcvcAAHArBXIDAQBwKB0AAAooHgAACgYtAxYrARgTB94NEw' +
- 'YRBigDAAAGEwfeABEHKgAAAEEcA{e}UDAAAFAwAADQA{4}IAAAFKAiwIAm8fAAAKKwEUKAQA' +
- 'AAYqAAMwAgACAgA{8}IoIAAACi03KCEAAApvIgAACh8MKBwAAAooIQAACnLZAQBwbyMAAAof' +
- 'DygcAAAKKCEAAAoCbyQAAAooHgAACighAAAKbyIAAAooIQAACnLrAQBwbyQAAAooIQAACnIZ' +
- 'AgBwbyQAAAooIQAACm8iAAAKKCEAAApyVQIAcG8jAAAKHw8oHAAACighAAAKcmcCAHBvJAAA' +
- 'CigeAAAKKCEAAApvIgAACighAAAKctECAHBvIwAACh8PKBwAAAooIQAACnLzAABwbyMAAAoo' +
- 'HgAACighAAAKcuMCAHBvIwAACh8PKBwAAAooIQAACnL3AABwbyMAAAooHgAACighAAAKcu0C' +
- 'AHBvJAAACh8PKBwAAAooIQAACnIVAwBwbyMAAAooHgAACighAAAKcuMCAHBvIwAACh8PKBwA' +
- 'AAooIQAACnIDAQBwbyMAAAooHgAACighAAAKcikDAHBvJAAACh8PKBwAAAooIQAACnJRAwBw' +
- 'byMAAAooHgAACighAAAKcmcDAHBvJAAACh8PKBw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wA{7}4AAgAAQBB' +
- 'AHMAcwBlAG0AYgBsAHkAIABWAGUAcgBzAGkAbwBuA{4}MQAuADEALgAwAC4AMA{9}Dvu788P' +
- '3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJVVEYtOCIgc3RhbmRhbG9uZT0ieWVzIj8+D' +
- 'Qo8YXNzZW1ibHkgeG1sbnM9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206YXNtLnYxIiBtY' +
- 'W5pZmVzdFZlcnNpb249IjEuMCI+DQogIDxhc3NlbWJseUlkZW50aXR5IHZlcnNpb249IjEuM' +
- 'C4wLjAiIG5hbWU9Ik15QXBwbGljYXRpb24uYXBwIi8+DQogIDx0cnVzdEluZm8geG1sbnM9I' +
- 'nVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206YXNtLnYyIj4NCiAgICA8c2VjdXJpdHk+DQogI' +
- 'CAgICA8cmVxdWVzdGVkUHJpdmlsZWdlcyB4bWxucz0idXJuOnNjaGVtYXMtbWljcm9zb2Z0L' +
- 'WNvbTphc20udjMiPg0KICAgICAgICA8cmVxdWVzdGVkRXhlY3V0aW9uTGV2ZWwgbGV2ZWw9I' +
- 'mFzSW52b2tlciIgdWlBY2Nlc3M9ImZhbHNlIi8+DQogICAgICA8L3JlcXVlc3RlZFByaXZpb' +
- 'GVnZXM+DQogICAgPC9zZWN1cml0eT4NCiAgPC90cnVzdEluZm8+DQo8L2Fzc2VtYmx5Pg0KA' +
- '{k}MAAADA{4}KA2A{im}==';
-
- //执行主函数
- main();
复制代码
作者: ygqiang 时间: 2017-4-12 19:40
回复 7# yu2n
保存为js文件。双击, xp系统测试不通过。
行53 字符2 错误‘null’为空或不是对象
作者: 老刘1号 时间: 2017-4-12 22:34
回复 8# ygqiang
测试2楼,存批
作者: ygqiang 时间: 2017-4-12 23:21
回复 2# 老刘1号
需要netframe4.0环境支持。测试不通过。
作者: yu2n 时间: 2017-4-13 00:05
本帖最后由 pcl_test 于 2017-4-13 00:32 编辑
回复 8# ygqiang
XP?可能 Zip 调用方式不同。那就不用Zip吧,代码会长一点,已在原楼层修改
作者: ygqiang 时间: 2017-4-13 10:06
回复 11# yu2n
win7 系统测试通过。 xp系统测试不行。
提示NumLock.exe 应用程序错误 正常初始化失败
作者: ygqiang 时间: 2017-4-13 10:44
本帖最后由 ygqiang 于 2017-4-13 10:47 编辑
回复 5# pcl_test
你好,你的代码,能否跟1楼代码。合并下。
实现
1、你的vbs代码判断灯如果没有打开,就运行1楼这个vbs代码。如果灯打开了,就直接退出
2、你的vbs代码,不需要弹出任何提示窗口,后台静默执行。
作者: 老刘1号 时间: 2017-4-13 12:53
本帖最后由 老刘1号 于 2017-4-13 12:55 编辑
回复 13# ygqiang
诶我说,这么简单的合并问题还要麻烦斑竹
人家关注你,给你提出判断方法就不错了
说句不好听的,你非要等人家将馒头嚼烂才能吃进去?
想清楚,这终究是自己的工作
自己每天不思进取,就靠别人帮忙?
网上随便找一个vbs教程,看10分钟,
修改这个一点问题也没有
看看那点可怜的技术分
多帮助别人,才能有更多的人帮助你
如果你实在不想动手,可以发有偿区
来这里伸手就说不过去了吧
作者: yu2n 时间: 2017-4-13 19:23
回复 12# ygqiang
你的XP版本是什么?我的 Windows XP CHS SP3 无此问题。
作者: ygqiang 时间: 2017-4-13 19:51
本帖最后由 ygqiang 于 2017-4-13 19:53 编辑
回复 15# yu2n
ghost tudou xpsp3版本。
xp系统暂时不考虑了。简单修改注册表就能实现。xp默认一直开启numlock灯。- ;14寸及以下笔记本勿改,否则开启数字键盘后字母变数字的。
- ;一般台机或者大尺寸笔记本都有数字键,在键盘右侧,方便直接输入数字
- cls
-
- reg add "HKEY_CURRENT_USER\Control Panel\Keyboard" /f /v "InitialKeyboardIndicators" /t REG_SZ /d 2
-
- reg add "HKEY_USERS\.DEFAULT\Control Panel\Keyboard" /f /v "InitialKeyboardIndicators" /t REG_SZ /d 2
-
- 1pause
-
- shutdown.exe -r -t 1
- 1pause
-
- shutdown.exe -r -f
-
-
- exit
复制代码
作者: hzf1019 时间: 2017-4-16 13:22
学习了,热处理语言真的很美~~
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |