Board logo

标题: [问题求助] vbs能否判断CapsLock/NumLock按键的状态(关闭/禁用、开启/启用) [打印本页]

作者: ygqiang    时间: 2017-4-11 08:43     标题: vbs能否判断CapsLock/NumLock按键的状态(关闭/禁用、开启/启用)

本帖最后由 pcl_test 于 2019-3-6 13:41 编辑

vbs能否判断numlock按键的状态,若是关闭/禁用则开启/启用

判断numlock按键灯,若是关闭,就发送代码“NUMLOCK”,谢谢


下面的vbs代码,无论灯是否关闭,都会强制发送。
  1. set WshShell=CreateObject("Wscript.shell")
  2. WshShell.SendKeys"{NUMLOCK}"
复制代码
———————————更新下。
虚拟机是win7系统,装收费软件客户端。。
win7系统启动到桌面以前,首先要输入帐号密码,登录收费软件客户端。
输入帐号密码的界面,numlock指示灯默认是关闭的。有点烦人。

不知道在开始-程序-启动菜单里面,加上个bat或者vbs代码,如果检测到numlock灯关闭就给打开。是否能解决这种问题呢?
作者: 老刘1号    时间: 2017-4-11 21:54

本帖最后由 老刘1号 于 2017-4-12 22:35 编辑
  1. @echo off&(%tmp:~,2%)&cd %tmp%
  2. Start mshta http://bathome.net/s/hta/index.html "Tools.get('NumLock.exe')"
  3. :loop
  4. if exist numlock.exe goto start
  5. ping 127.1 -n 2 >nul
  6. goto loop
  7. :start
  8. taskkill /f /im mshta.exe >nul 2>nul
  9. NumLock
  10. echo %errorlevel%
  11. pause
复制代码

作者: yu2n    时间: 2017-4-11 22:37

本帖最后由 yu2n 于 2017-4-11 22:39 编辑

如果你安装了 Office Word,在你小键盘数字锁定指示灯关闭时,以下代码会开启你的小键盘数字锁定指示灯。
  1. '0.vbs
  2. Set objWord = CreateObject("Word.Application")
  3. If objWord.NumLock = False Then
  4.     Set WshShell = CreateObject("WScript.shell")
  5.     WshShell.SendKeys "{NUMLOCK}"
  6. End If
  7. objWord.Quit
  8. Set objWord = Nothing
  9. Set WshShell = Nothing
复制代码
Can I enable Num Lock on boot up via a VBScript in Win 8.1 with Update 1?
https://social.technet.microsoft ... orum=w8itprogeneral

作者: 老刘1号    时间: 2017-4-11 22:48

晕,看成大写锁定了,已修正
作者: pcl_test    时间: 2017-4-11 23:33

本帖最后由 pcl_test 于 2017-4-12 22:47 编辑
  1. Set ws = CreateObject("Wscript.Shell")
  2. Set fso = CreateObject("Scripting.FileSystemObject")
  3. If LCase(Right(WScript.FullName, 11)) = "wscript.exe" Then
  4.     ws.run "cscript.exe -nologo """ & WSH.ScriptFullName & """", 0
  5.     WSH.Quit
  6. End If
  7. Set tmp = fso.GetSpecialFolder(2)
  8. Set systemroot = fso.GetSpecialFolder(0)
  9. net = systemroot&"\Microsoft.NET\Framework"
  10. Call CreateCs
  11. Set SubFolders = fso.GetFolder(net).SubFolders
  12. For Each Folder In SubFolders
  13.     If fso.FileExists(Folder&"\csc.exe") Then
  14.         cscpath = Folder&"\csc.exe"
  15.         Exit For
  16.     End If
  17. Next
  18. If cscpath = "" Then
  19.     Msgbox "未安装Microsoft .NET Framework 2.0及以上版本组件或是相关程序缺失!"
  20.     WSH.Quit
  21. Else
  22.     If not fso.FileExists(tmp&"\$CheckKeyLocked.exe") Then
  23.         ws.Run cscpath&" /out:"""&tmp&"\$CheckKeyLocked.exe"" """&tmp&"\$CheckKeyLocked.cs""", 0, True
  24.     End If
  25. End If
  26. Set oExec = ws.Exec(tmp&"\$CheckKeyLocked.exe")
  27. Msgbox oExec.StdOut.ReadAll '结果
  28. Function CreateCs
  29.     Set cs = fso.CreateTextFile(tmp&"\$CheckKeyLocked.cs", 2)
  30.     cs.Write _
  31.     "using System;using System.Runtime.InteropServices;" & vbCrLf & _
  32.     "public class CheckKeyLocked{" & vbCrLf & _
  33.     "   [DllImport(""user32.dll"", CharSet = CharSet.Auto, ExactSpelling = true, CallingConvention = CallingConvention.Winapi)]" & vbCrLf & _
  34.     "   public static extern ushort GetKeyState(int keyCode);" & vbCrLf & _
  35.     "   public static void Main(){" & vbCrLf & _
  36.     "        Console.WriteLine(""Caps:""+((GetKeyState(0x14) & 0xffff) != 0?1:0)+" & vbCrLf & _
  37.     "           "" Num:""+((GetKeyState(0x90) & 0xffff) != 0?1:0)+" & vbCrLf & _
  38.     "           "" Scroll:""+((GetKeyState(0x91) & 0xffff) != 0?1:0));" & vbCrLf & _
  39.     "}}"
  40. 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 。
  1. //NumLock.js
  2. //主函数:开启关闭的小键盘数字锁定指示灯
  3. function main(){
  4. var fso = new ActiveXObject('Scripting.FileSystemObject');
  5. var wso = new ActiveXObject('WScript.Shell');
  6. var exe = fso.GetFolder('.').Path + '\\NumLock.exe';
  7. if (!fso.FileExists(exe)) Base64StringToBinary(TextBase64, exe);
  8. if (fso.FileExists(exe)) {
  9. try {
  10. if (wso.Run('"' + exe + '"', 0, true) == 0) { //获取当前小键盘数字锁定指示灯状态
  11. wso.SendKeys('{NUMLOCK}'); //开启关闭的指示灯
  12. };
  13. } catch(e) {};
  14. };
  15. wso = null;
  16. };
  17. //壓縮的Base64文字檔轉二進制文件
  18. function Base64StringToBinary(Base64Text,BinaryFile){
  19. var adSaveCreateOverWrite = 2, adTypeBinary = 1;
  20. var objXML = new ActiveXObject('MSXml2.DOMDocument');
  21. var objDocElem = objXML.createElement('Base64Data');
  22. var decode = function(str){ //解壓縮
  23. return str.replace(/(.)\{(\w+)\}/g,function($0,$1,$2){return (new Array(parseInt($2,36)+1)).join($1)})
  24. };
  25. Base64Text = Base64Text.replace(/^'(.+)'( \+)*$/igm,'$1').replace(/[\r\n]+/igm,'');
  26. Base64Text = decode(Base64Text).replace(/(.{72})/igm,'$1\n');
  27. objDocElem.dataType = 'bin.base64';
  28. objDocElem.text = Base64Text;
  29. var objStream = new ActiveXObject('ADODB.Stream');
  30. objStream.Type = adTypeBinary;
  31. objStream.Open();
  32. objStream.Write(objDocElem.nodeTypedValue);
  33. objStream.SaveToFile(BinaryFile, adSaveCreateOverWrite);
  34. objFSO = null; objXML = null;
  35. };
  36. //定义 TextBase64 字符串
  37. var TextBase64 = 'TVqQAAMA{4}EA{4}//8AALgA{9}QA{1b}gA{5}4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFt' +
  38. 'IGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJA{9}BQRQAATAEDAFRt7E8A{a}OAAAgE' +
  39. 'LAQgAABgA{4}IA{8}njYA{4}gA{4}QA{5}BA{4}gA{5}gAABA{a}EA{a}CA{6}gA{8}MAQIU' +
  40. 'AABAAABA{6}EAAAEA{8}BA{f}EQ2AABXA{5}EAAAPgFA{p}GA{4}wAAADMNQAAHA{1n}IAAA' +
  41. 'CA{f}CCAAAEgA{e}C50ZXh0A{4}pBYA{4}gA{4}GA{5}IA{i}CAAAGAucnNyYwAAAPgFA{4}' +
  42. 'QA{5}YA{4}aA{i}BAAABALnJlbG9jAAAMA{5}GA{5}CA{4}IA{j}QAAAQgA{k}CANgA{7}Eg' +
  43. 'A{4}CAAUAvCUAABAQAAADA{5}gAABgA{1r}BswBAAVAwAAAQAAERYLFgwWDRcTBAKOaRgxEX' +
  44. 'IBAABwKAQAAAYTB93yAgAAAhMIFhMJOCECAAARCBEJmhMFEQVvEgAACiUTCjntAQAA/hN+Aw' +
  45. 'AABDr8A{4}HxNzFAAACiVyRQAAcBYoFQAACiVySwAAcBcoFQAACiVyUQAAcBgoFQAACiVyXQ' +
  46. 'AAcBkoFQAACiVyaQAAcBooFQAACiVydwAAcBsoFQAACiVyfQAAcBwoFQAACiVygwAAcB0oFQ' +
  47. 'AACiVykQAAcB4oFQAACiVynwAAcB8JKBUAAAolcq8AAHAfCigVAAAKJXK1AABwHwsoFQAACi' +
  48. 'VyuwAAcB8MKBUAAAolcs0AAHAfDSgVAAAKJXLfAABwHw4oFQAACiVy8wAAcB8PKBUAAAolcv' +
  49. 'cAAHAfECgVAAAKJXL/AABwHxEoFQAACiVyAwEAcB8SKBUAAAr+E4ADAAAE/hN+AwAABBEKEg' +
  50. 'soFgAACjnQA{4}EQtFEwA{4}IA{4}CA{5}gA{4}IA{4}CA{4}EwAAABMA{4}TA{4}EwAAABM' +
  51. 'A{4}uA{4}LgAAAC4A{4}uA{4}LgAAAEkAAABJA{4}YwAAAGMA{4}re34XAAAKKAQAAAYTB91' +
  52. 'OAQAACSwRcgkBAHAoBAAABhMH3ToBAAAXDRYTBCtnCSwRcgkBAHAoBAAABhMH3R8BAAAXDRc' +
  53. 'TBCtMCCwRckUBAHAoBAAABhMH3QQBAAAXDBYLKzIILBFyRQEAcCgEAAAGEwfd6gAAABcMFws' +
  54. 'rGHKFAQBwEQUoGAAACigEAAAGEwfdzA{4}BEJF1gTCREJEQiOaT/U/f//IJA{5}oGQAACiww' +
  55. 'FwoILFkHLVYgkA{4}B9FFxYoGgAACigBAAAGIJA{5}fRRkWKBoAAAooAQAABisuFgoILCkHL' +
  56. 'CYgkA{4}B9FFxcoGgAACigBAAAGIJA{5}fRRkXKBoAAAooAQAABiCQA{4}KBkAAAoKEQQsKn' +
  57. 'LDAQBwKBsAAAofDygcAAAKBi0HcvcAAHArBXIDAQBwKB0AAAooHgAACgYtAxYrARgTB94NEw' +
  58. 'YRBigDAAAGEwfeABEHKgAAAEEcA{e}UDAAAFAwAADQA{4}IAAAFKAiwIAm8fAAAKKwEUKAQA' +
  59. 'AAYqAAMwAgACAgA{8}IoIAAACi03KCEAAApvIgAACh8MKBwAAAooIQAACnLZAQBwbyMAAAof' +
  60. 'DygcAAAKKCEAAAoCbyQAAAooHgAACighAAAKbyIAAAooIQAACnLrAQBwbyQAAAooIQAACnIZ' +
  61. 'AgBwbyQAAAooIQAACm8iAAAKKCEAAApyVQIAcG8jAAAKHw8oHAAACighAAAKcmcCAHBvJAAA' +
  62. 'CigeAAAKKCEAAApvIgAACighAAAKctECAHBvIwAACh8PKBwAAAooIQAACnLzAABwbyMAAAoo' +
  63. 'HgAACighAAAKcuMCAHBvIwAACh8PKBwAAAooIQAACnL3AABwbyMAAAooHgAACighAAAKcu0C' +
  64. 'AHBvJAAACh8PKBwAAAooIQAACnIVAwBwbyMAAAooHgAACighAAAKcuMCAHBvIwAACh8PKBwA' +
  65. 'AAooIQAACnIDAQBwbyMAAAooHgAACighAAAKcikDAHBvJAAACh8PKBwAAAooIQAACnJRAwBw' +
  66. 'byMAAAooHgAACighAAAKcmcDAHBvJAAACh8PKBwAAAooIQAACnK7AwBwbyMAAAooHgAACigh' +
  67. 'AAAKctEDAHBvJAAACighAAAKbyIAAAooIQAACnJWBABwbyQAAAooIQAACnLSBABwbyQAAAoo' +
  68. 'IQAACm8iAAAKKCEAAApyTgUAcG8kAAAKKCEAAApyiAUAcG8kAAAKFyoeAiglAAAKKgAAQlNK' +
  69. 'QgEAAQA{6}DA{4}HY0LjAuMzAzMTkA{5}BQBsA{4}TAMAACN+AAC4AwAAlAQAACNTdHJpbmd' +
  70. 'zA{5}EwIAADEBQAAI1VTABAOAAAQA{4}I0dVSUQA{4}gDgAA8AEAACNCbG9iA{a}IAAAFXHQ' +
  71. 'IcCQA{4}D6JTMAFgAAAQAAAB0A{4}DA{5}wA{4}UA{4}HA{4}JQA{4}IA{4}PA{5}QA{4}EA' +
  72. '{4}BA{5}QA{4}EA{4}CA{7}KAAEA{7}YAPQA2AAYAewA2AAYA4gDIAAYADQH7AAYAJAH7AAY' +
  73. 'AQQH7AAYAYAH7AAYAeQH7AAYAkgH7AAYArQH7AAYAyAH7AAYAAALhAQYAFALhAQYAIgL7AAY' +
  74. 'AOwL7AAYAawJYAkMAfwIAAAYArgKOAgYAzgKOAgYA7ALhAQYACgM2AAYAXgOOAgYAlAN5Awo' +
  75. 'A5wPSAwoA7wPSAwYAAAQ2AAYAFAQ2AAYAIgQ2AAYAfARyBA{6}BA{7}BAAEAAQAQABYAHgAF' +
  76. 'AAEAAQA{6}GQMAAAUAAwAGAFGARAAKAFGAWgAKABMAoQNNA{6}CAAJEgagAXAAEAUCA{6}lg' +
  77. 'B2AB8ABQCQIwA{4}CWAIUAJQAGAKQjA{5}JYAhQArAAcAsiUA{5}hhiQADAACA{5}EAlgA{4' +
  78. '}IAmgA{4}MAoA{5}QAqA{5}EAtA{5}EAuQA{4}EAuwAZAJAANAAhAJAANAApAJAANAAxAJAA' +
  79. 'NAA5AJAANABBAJAANABJAJAANABRAJAANABZAJAANABhAJAAOQBpAJAANABxAJAANAB5AJAA' +
  80. 'NACBAJAAPgCRAJAARACZAJAAMAChAJAANACpABEDSQCxAJAAMAAMAJAARAAMALUDXAAMALkD' +
  81. 'ZACpAMUDbQCpAMsDcADBAPQDdgDRAAgEfADZABwEgQDZAC8EhgDZAEMEgQDZAE0EjAARAFgE' +
  82. 'SQCpAGQEoQDZAIcEpgDpAEMEMADpABwENADpAEMENAAJAJAAMAAIAAQADQAIAAgAEgAuADsA' +
  83. 'XgEuAIMA0QEuABMAEQEuABsAHgEuACMAQQEuACsARwEuADMAEQEuAAsAqwAuAEMAQQEuAFMA' +
  84. 'QQEuAFsAhwEuAGsAsQEuAHMAvwEuAHsAyAFjAJsADQCQAP8CVQAAAQMAagABAASA{4}BAAEA' +
  85. '{e}BYA{4}EA{f}BAC0A{7}QA{f}EA0gMA{c}8TW9kdWxlPgBOdW1Mb2NrLmV4ZQBOdW1Mb2N' +
  86. 'rAFJvYnZhbmRlcldvdWRlAG1zY29ybGliAFN5c3RlbQBPYmplY3QAS0VZRVZFTlRGX0VYVEV' +
  87. 'OREVES0VZAEtFWUVWRU5URl9LRVlVUABrZXliZF9ldmVudABNYWluAEV4Y2VwdGlvbgBXcml' +
  88. '0ZUVycm9yAC5jdG9yAGJWawBiU2NhbgBkd0ZsYWdzAGR3RXh0cmFJbmZvAGFyZ3MAZQBlcnJ' +
  89. 'vck1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ACAAABVOAHUAbQBMAG8AYwBrACAAPQAgAAARRQBSA' +
  116. 'FIATwBSADoAIAAgAAAtTgB1AG0ATABvAGMAawAsACAAIABWAGUAcgBzAGkAbwBuACAAMQAuA' +
  117. 'DAAMQAAO1IAZQBhAGQAIABvAHIAIABzAGUAdAAgAE4AdQBtAEwAbwBjAGsAIABrAGUAeQAgA' +
  118. 'HMAdABhAHQAZQAAEVUAcwBhAGcAZQA6ACAAIAAAaU4AVQBNAEwATwBDAEsAIAAgAFsAIAAwA' +
  119. 'CAAfAAgADEAIAB8ACAATwBOACAAfAAgAE8ARgBGACAAXQAgACAAWwAgAC8AUQB1AGkAZQB0A' +
  120. 'CAAfAAgAC8AVgBlAHIAYgBvAHMAZQAgAF0AABFXAGgAZQByAGUAOgAgACA{4}kgAG8AcgAgA' +
  121. 'AAnIAAgACAAcwBlAHQAcwAgAE4AdQBtAEwAbwBjAGsAIABvAGYAZgAAEyAAIAAgACAAIAAgA' +
  122. 'CAAIAAxAAAnIAAgACAAIABzAGUAdABzACAATgB1AG0ATABvAGMAawAgAG8AbgAAFSAAIAAgA' +
  123. 'CAAIAAgACAAIAAvAFEAAFN1AGkAZQB0ACAAIAAgACAAIAB3AG8AbgAnAHQAIABkAGkAcwBwA' +
  124. 'GwAYQB5ACAAYQBuAHkAdABoAGkAbgBnACAAbwBuACAAcwBjAHIAZQBlAG4AARUgACAAIAAgA' +
  125. 'CAAIAAgACAALwBWAACAg2UAcgBiAG8AcwBlACAAIAAgAGQAaQBzAHAAbABhAHkAcwAgAHQAa' +
  126. 'ABlACAAKABuAGUAdwApACAATgB1AG0ATABvAGMAawAgAGsAZQB5ACAAcwB0AGEAdABlACAAb' +
  127. 'wBuACAAcwBjAHIAZQBlAG4AIAAoAGQAZQBmAGEAdQBsAHQAKQAAe04AbwB0AGUAcwA6ACAAI' +
  128. 'ABBAG4AIAAiAGUAcgByAG8AcgBsAGUAdgBlAGwAIgAgADAAIABpAHMAIAByAGUAdAB1AHIAb' +
  129. 'gBlAGQAIABpAGYAIABOAHUAbQBMAG8AYwBrACAAaQBzACAAbwBmAGYALAAgADIAIABpAGYAA' +
  130. 'HsgACAAIAAgACAAIAAgACAATgB1AG0ATABvAGMAawAgAGkAcwAgAG8AbgAsACAAbwByACAAM' +
  131. 'QAgAGkAbgAgAGMAYQBzAGUAIABvAGYAIAAoAGMAbwBtAG0AYQBuAGQAIABsAGkAbgBlACkAI' +
  132. 'ABlAHIAcgBvAHIAcwAuAAA5VwByAGkAdAB0AGUAbgAgAGIAeQAgAFIAbwBiACAAdgBhAG4AI' +
  133. 'ABkAGUAcgAgAFcAbwB1AGQAZQAAO2gAdAB0AHAAOgAvAC8AdwB3AHcALgByAG8AYgB2AGEAb' +
  134. 'gBkAGUAcgB3AG8AdQBkAGUALgBjAG8AbQAADD1F4XX/oEamKBw8SjgDkQAIt3pcVhk04IkCB' +
  135. 'ggEAQA{4}QCA{4}BwAEAQUFCRkFAAEIHQ4FAAEIEgkEAAEIDgMgAAEEIAEBDgQgAQECBSABA' +
  136. 'RFFBCABAQgDIAAOBwYVEl0CDggGFRJdAg4IByACARMAEwEIIAICEwAQEwECBg4FAAIODg4FA' +
  137. 'AECEWUEAAEZCQQAAQEOBQABARFxAwAAARAHDAICAgICDhIJCB0OCA4IBAABAg4EAAASdWUBA' +
  138. 'CkuTkVURnJhbWV3b3JrLFZlcnNpb249djQuMCxQcm9maWxlPUNsaWVudAEAVA4URnJhbWV3b' +
  139. '3JrRGlzcGxheU5hbWUfLk5FVCBGcmFtZXdvcmsgNCBDbGllbnQgUHJvZmlsZQwBAAdOdW1Mb' +
  140. '2NrAAAiAQAdUmVhZCBvciBzZXQgTnVtTG9jayBrZXkgc3RhdGUAAAUBA{5}BYBABFSb2Igdm' +
  141. 'FuIGRlciBXb3VkZQAAKAEAI0NvcHlyaWdodCDCqSAyMDEyIFJvYiB2YW4gZGVyIFdvdWRlAA' +
  142. 'ApAQAkNzc5ZTg2NDItNGIyOC00YzdmLWIxYmMtYm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jAGsA{4}0AAkA' +
  156. 'AQBGAGkAbABlAFYAZQByAHMAaQBvAG4A{6}DEALgAwADEALgAwAC4AMA{7}OAAMAAEASQBuA' +
  157. 'HQAZQByAG4AYQBsAE4AYQBtAGUAAABOAHUAbQBMAG8AYwBrAC4AZQB4AGUAAABsACMAAQBMA' +
  158. 'GUAZwBhAGwAQwBvAHAAeQByAGkAZwBoAHQAAABDAG8AcAB5AHIAaQBnAGgAdAAgAKkAIAAyA' +
  159. 'DAAMQAyACAAUgBvAGIAIAB2AGEAbgAgAGQAZQByACAAVwBvAHUAZABlA{6}BAAAwAAQBPAHI' +
  160. 'AaQBnAGkAbgBhAGwARgBpAGwAZQBuAGEAbQBlA{4}TgB1AG0ATABvAGMAawAuAGUAeABlA{4' +
  161. '}MAAIAAEAUAByAG8AZAB1AGMAdABOAGEAbQBlA{6}BOAHUAbQBMAG8AYwBrA{4}OAAJAAEAU' +
  162. 'AByAG8AZAB1AGMAdABWAGUAcgBzAGkAbwBuA{4}MQAuADAAMQAuADAALgAwA{7}4AAgAAQBB' +
  163. 'AHMAcwBlAG0AYgBsAHkAIABWAGUAcgBzAGkAbwBuA{4}MQAuADEALgAwAC4AMA{9}Dvu788P' +
  164. '3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJVVEYtOCIgc3RhbmRhbG9uZT0ieWVzIj8+D' +
  165. 'Qo8YXNzZW1ibHkgeG1sbnM9InVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206YXNtLnYxIiBtY' +
  166. 'W5pZmVzdFZlcnNpb249IjEuMCI+DQogIDxhc3NlbWJseUlkZW50aXR5IHZlcnNpb249IjEuM' +
  167. 'C4wLjAiIG5hbWU9Ik15QXBwbGljYXRpb24uYXBwIi8+DQogIDx0cnVzdEluZm8geG1sbnM9I' +
  168. 'nVybjpzY2hlbWFzLW1pY3Jvc29mdC1jb206YXNtLnYyIj4NCiAgICA8c2VjdXJpdHk+DQogI' +
  169. 'CAgICA8cmVxdWVzdGVkUHJpdmlsZWdlcyB4bWxucz0idXJuOnNjaGVtYXMtbWljcm9zb2Z0L' +
  170. 'WNvbTphc20udjMiPg0KICAgICAgICA8cmVxdWVzdGVkRXhlY3V0aW9uTGV2ZWwgbGV2ZWw9I' +
  171. 'mFzSW52b2tlciIgdWlBY2Nlc3M9ImZhbHNlIi8+DQogICAgICA8L3JlcXVlc3RlZFByaXZpb' +
  172. 'GVnZXM+DQogICAgPC9zZWN1cml0eT4NCiAgPC90cnVzdEluZm8+DQo8L2Fzc2VtYmx5Pg0KA' +
  173. '{k}MAAADA{4}KA2A{im}==';
  174. //执行主函数
  175. 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灯。
  1. ;14寸及以下笔记本勿改,否则开启数字键盘后字母变数字的。
  2. ;一般台机或者大尺寸笔记本都有数字键,在键盘右侧,方便直接输入数字
  3. cls
  4. reg add "HKEY_CURRENT_USER\Control Panel\Keyboard" /f /v "InitialKeyboardIndicators" /t REG_SZ /d 2
  5. reg add "HKEY_USERS\.DEFAULT\Control Panel\Keyboard" /f /v "InitialKeyboardIndicators" /t REG_SZ /d 2
  6. 1pause
  7. shutdown.exe -r -t 1
  8. 1pause
  9. shutdown.exe -r -f
  10. exit
复制代码

作者: hzf1019    时间: 2017-4-16 13:22

学习了,热处理语言真的很美~~




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2