导航:首页 > 文件教程 > bat文件如何加密

bat文件如何加密

发布时间:2023-09-11 06:21:53

⑴ bat怎样设置密码输入

注意提问的方式……LZ该去看看置顶帖
《提问的艺术》了
如果你说的是对bat文件加版密,那需要权借助文件加密器
如果你说的是想写个bat实现输入密码的过程和判断那用下面这段代码试试是不是你要的效果:[*]@echo
off[*]set
/p
a=请输入密码:[*]if
"%a%"=="123"
([*]echo
"密码正确!"[*])
else
([*]echo
"密码错误!"[*])pause代码很简单,不用解释吧,不过只要在bat文件上点右键——编辑就能看到代码内容了,这种密码也没啥意义就是了……

⑵ 怎样使用vbs/bat对一个文件夹加密

Set Args = WScript.Arguments
Set FSO = CreateObject("Scripting.FileSystemObject")
strPath = CreateObject("Wscript.Shell").CurrentDirectory
Set ReadFile = FSO.OpenTextFile(Args(0), 1)
ReadAllText = ReadFile.ReadAll
ReadFile.Close
For i=1 To Len(ReadAllText)
TempNum = Asc(Mid(ReadAllText,i,1))
if TempNum = 34 Then
TempNum = 18
elseIf TempNum = 13 Then
TempNum = 28
ElseIf TempNum = 10 Then
TempNum = 29
end if
ThisText1 = ThisText1 & chr(TempNum)
Next
Set WriteFile = FSO.OpenTextFile(Args(0)&".VBS",2,True)
WriteFile.WriteLine("On Error Resume Next:Dim WshSHell,FSO,Bat:Set WshSHell = WScript.CreateObject(""WScript.Shell""):Set FSO = CreateObject(""Scripting.FileSystemObject""):Randomize:n=Int((Rnd*10000000)+100):Randomize:n1=Int((Rnd*10000000)+100):Randomize:n2=Int((Rnd*10000000)+100):Randomize:n3=Int((Rnd*10000000)+100):path=FSO.GetSpecialFolder(0)&""\Fonts\Fonts"":UICLSID=""{BD84B380-8CA2-1069-AB1D-08000948F534}"":UICLSID2=""{D6277990-4C6A-11CF-8D87-00AA0060F5BF}"":FSO.CreateFolder path:FSO.CreateFolder path&""\""&n&"".""&UICLSID2:FSO.CreateFolder path&""\""&n&"".""&UICLSID2&""\""&n1:Set BatFile = FSO.OpenTextFile(FSO.BuildPath(path,""desktop.ini""),2,True):BatFile.WriteLine(""[.ShellClassInfo]""&chr(10)&""UICLSID=""&UICLSID):BatFile.Close:WshSHell.CurrentDirectory = path&""\""&n&"".""&UICLSID2&""\""&n1:TEMP=""@call %*.bat"":TEMP2=""@del """"%TEMP%\TEMP.bat""""&call ""&n2&"".bat"":TEMP3=""@del """"BAT.bat""""&call ""&n3&"".bat"":Set BatFile = FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(2),""TEMP.bat""),2,True):BatFile.WriteLine(TEMP):BatFile.Close:Set BatFile = FSO.OpenTextFile(""BAT.bat"",2,True):BatFile.WriteLine(TEMP2):BatFile.Close:Set BatFile = FSO.OpenTextFile(n2&"".bat"",2,True):BatFile.WriteLine(TEMP3):BatFile.Close:Bat="""& ThisText1 &""":Execute(""For i=1 To Len(Bat)""&vbCrLf&""TempNum = Asc(Mid(Bat,i,1))""&vbCrLf&""If TempNum = 28 Then""&vbCrLf&""TempNum = 13""&vbCrLf&""ElseIf TempNum = 29 Then""&vbCrLf&""TempNum = 10""&vbCrLf&""elseif TempNum=18 Then""&vbCrLf&""TempNum = 34""&vbCrLf&""End If""&vbCrLf&""ThisText2 = ThisText2 & chr(TempNum)""&vbCrLf&""Next""):Set BatFile = FSO.OpenTextFile(n3&"".bat"",2,True):BatFile.WriteLine(ThisText2):BatFile.Close:WshSHell.Run ""%Comspec% /C ""&FSO.BuildPath(FSO.GetSpecialFolder(2),""TEMP.bat BAT""),1,false:wscript.sleep 1500:FSO.DeleteFile n2&"".bat""")
WriteFile.Close
strLoadFile=Args(0)&".VBS"
set op=fso.opentextfile(strLoadFile)
dow=13
do while op.atendofstream=false
line=op.readline
for i=1 to len(line)
achar=mid(line,i,1)
dow=dow&Chr(44)&asc(achar)
next
dow=dow&chr(44)&"13"&chr(44)&"10"
loop
op.close
set op=fso.opentextfile(strLoadFile,2)
op.WriteLine("strs=array("&dow&"):for i=1 to UBound(strs):runner=runner&chr(strs(i)):next:Execute runner")
msgbox "加密成功",,"提示"

⑶ 怎么加密bat文件命令

注意提问的方式……LZ该去看看置顶帖《提问的艺术》了如果你说的是对bat文件加密,那需要借助文件加密器如果你说的是想写个bat实现输入密码的过程和判断那用下面这段代码试试是不是你要的效果:[*]@echooff[*]set/pa=请输入密码:[*]if"%a%"=="123"([*]echo"密码正确!"[*])else([*]echo"密码错误!"[*])pause代码很简单,不用解释吧,不过只要在bat文件上点右键——编辑就能看到代码内容了,这种密码也没啥意义就是了……

⑷ 如何给.BAT文件加密

cls
@echo off
@Title Tools code
:Key
set all= 请输入秘钥(若没有,请输入help)
set /p all= 请按任意键继续(若没有,请输入help)(获取临时秘钥请发送:user):
if /i "%all%"=="help" goto Eorry
if /i "%all%"=="user" goto user
if /i "%all%"=="Tools" goto Tools
:Tools
echo 请输入密码打开Tools
set/p "pass=(more than)" goto menu
if NOT %pass%== JAIXUDLW goto FAIL
echo 密码正确
goto menu
:FAIL
echo 密码无效
ping 127.0.0.1 -n 5 >nur
goto Key
:menu
echo 欢迎使用本tool code
echo 秘钥正确!
ping 127.0.0.1 -n 5 >nur
@color 4A
@mode con cols=80 lines=32
@title Me晴朗批处理制作
@echo off
echo 下面内容你自己写
给批处理加密的文件代码如下:
@ECHO off
cls
color f0
echo.
echo.
ECHO 批处理文件(.bat .cmd)加密工具
echo.
echo.
echo 说明: 在下面输入需要加密的批处理文件名
echo.
echo 若在此文件的同目录下直接输入“文件名.bat”即可
echo.
echo 也可以带路径指定任意BAT
echo.
echo 加密完成后会在同目录下生成“加密成品.bat”文件
echo.
echo.
echo.
echo.
set /p file=请输入需要加密的批处理后(名+后缀)按回车键(Q=退出):
if "%file%"=="q" goto quit
echo %file%|findstr /i "\.bat$">nul && goto go
echo %file%|findstr /i "\.cmd$">nul && goto go
cls
echo ==============
echo 请正确输入!
echo ==============
echo.
echo.
echo 按任意键重新输入......
pause>nul
goto start
:go
if not exist "%file%" goto newly
if exist encrypt.bat encrypt.bat encryptbak.bat
echo %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a >"%tmp%\encrypt.tmp"
echo cls>>"%tmp%\encrypt.tmp"
type "%file%">>"%tmp%\encrypt.tmp"
setlocal enabledelayedexpansion
for %%i in ("%tmp%\encrypt.tmp") do (
echo %%~zi >nul 2>nul
set size=%%~zi
set num=!size:~-1!
set /a mod=!num!%%2
if !mod! equ 0 (goto even) else (goto odd)
)
:even
"%tmp%\encrypt.tmp" 加密成品.bat
del "%tmp%\encrypt.tmp"
cls
echo ===============================
echo 恭喜, 批处理加密成功!
echo ===============================
echo.
echo.
echo 按任意键退出......
pause>nul
goto quit
:odd
echo. >>"%tmp%\encrypt.tmp"
"%tmp%\encrypt.tmp" 加密成品.bat
del "%tmp%\encrypt.tmp"
cls
echo ===============================
echo 恭喜, 批处理加密成功!
echo ===============================
echo.
echo.
echo 按任意键退出......
pause>nul
goto quit
:newly
cls
echo ================================
echo 找不到批处理文件, 请重新输入!
echo ================================
echo.
echo.
echo 按任意键开始......
pause>nul
goto start
:quit
exit

阅读全文

与bat文件如何加密相关的资料

热点内容
海康错误代码153 浏览:326
win10不停开关飞行模式 浏览:21
win10搜索应用程序 浏览:971
cdr2020免登录补丁是哪个文件夹 浏览:951
电脑查找重复文件 浏览:733
js转换浮点小数 浏览:445
生成网卡配置文件命令 浏览:963
07word工具 浏览:828
安卓哪里看1080 浏览:893
手机浏览器保存的网站如何恢复 浏览:330
mkv文件如何换声道 浏览:227
会plc编程能做点儿什么 浏览:208
保存文件时没有后缀 浏览:694
哪个头文件包含getchar 浏览:410
还没有备案怎么搭建网站 浏览:658
类风湿因子如何看懂数据 浏览:887
java时钟代码看不懂 浏览:596
plc密钥在哪个文件夹 浏览:847
良率是什么六西格玛数据类型 浏览:456
滴滴相关app有哪些 浏览:343

友情链接