[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
我前两天才开始接触批处理,这几天狠啃这块,感觉这个例子对于新手熟悉命令还是很好的啊,而且感觉也能感受到一点程序化设计的方法:先整体框架,再在框架里写功能模块,很好的,顶一个!楼主代码最后没有做到自动恢复的功能,这样一些电脑不够好的朋友可能真的误认为是蓝屏而重启电脑。现修改了楼主一点点的代码,以实现自动恢复功能:
  1. @echo off
  2. echo.
  3. :head
  4. set/p var=请任意猜一个数字:
  5. echo 你猜错了,所以电脑蓝屏了,做为对你的惩罚,哈哈!!!!
  6. if %var%==2010 goto right else goto error
  7. :error
  8. > temp.hta echo ^<html^>
  9. >>temp.hta echo     ^<HTA:APPLICATION Application BORDER="None" WINDOWSTATE="Maximize" SCROLL="No" INNERBORDER="No" SELECTION="No"/^>
  10. >>temp.hta echo     ^<body style="background-color:#00D;color:#EEE;font-family:consolas;font-size:12pt;font-weight:lighter;cursor:url(fuck);"^>
  11. >>temp.hta echo  A problem has been detected and windows has been shut down to prevent damage^
  12. >>temp.hta echo  to your computer.^
  13. >>temp.hta echo  ^
  14. >>temp.hta echo  NO_MORE_IRP_STACK_LOCATIONS^
  15. >>temp.hta echo  ^
  16. >>temp.hta echo  If this is the first time you've seen this stop error screen,^
  17. >>temp.hta echo  restart your computer.If this screen appears again,follow^
  18. >>temp.hta echo  these steps:^
  19. >>temp.hta echo  ^
  20. >>temp.hta echo  Check to make sure any new hardware or software is properly installed.^
  21. >>temp.hta echo  If this is a new installation, ask your hardware or software manufacturer^
  22. >>temp.hta echo  for any windows updates you might need.^
  23. >>temp.hta echo  ^
  24. >>temp.hta echo  If problems continue,disable or remove any newly installed hardware^
  25. >>temp.hta echo  or software. Disable BIOS memory options such as caching or shadowing.^
  26. >>temp.hta echo  If you need to use safe Mode to remove or disable components, restart^
  27. >>temp.hta echo  your computer,press F8 to select Advanced startup Options,and then^
  28. >>temp.hta echo  select safe mode.^
  29. >>temp.hta echo  ^
  30. >>temp.hta echo  Technical information:^
  31. >>temp.hta echo  ^
  32. >>temp.hta echo  *** STOP: 0x00000024 (0x001902FE,0xF7A4F660,0xF7A4F35C,0xF73CB7B6)^
  33. >>temp.hta echo  ^
  34. >>temp.hta echo  *** ntfs.sys - address F73CB7B6 base at F73CB000, Datestamp 41107eea^
  35. >>temp.hta echo  ^
  36. >>temp.hta echo  Beginning dump of physical memory^
  37. >>temp.hta echo  Physical memory dump complete.^
  38. >>temp.hta echo  Contact your system administrator or technical support group for further^
  39. >>temp.hta echo  assistance.^
  40. >>temp.hta echo     ^</body^>
  41. >>temp.hta echo ^</html^>
  42. start temp.hta && taskkill /f /im explorer.exe>nul
  43. ping 127.0.0.1 -n 10> nul
  44. taskkill /f /im  mshta.exe>nul  && del temp.hta  && C:\WINDOWS\explorer.exe
  45. :right
  46. cls
  47. echo 你也太聪明了吧,这都能猜到,没意思,我走了……
  48. pause>nul
复制代码

TOP

菜鸟求教:能否在批处理中实现禁用 ALT 键的功能?如果可以的话,上面那个“蓝屏”程序,就更逼真了,"Alt+Tab" 和 "Ctrl+Alt+Esc"都不可用了。
额,不是想恶搞,只是通过趣味小程序的编写,来进行学习,呵呵。

TOP

并不是rundll32 动态链接文件库缺失或损坏了,而是根本不存在!比如
rundll32  shell32,Control_RunDLL 这个命令就是可行的
而像锁键盘或鼠标那些命令,好像是Win98时代的,NT的系统都不适用
想其它办法吧……

TOP

返回列表