⑴ 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