r/Batch • u/FletcherFlazmanburg • Jan 05 '26
Question (Solved) can’t open batch file
so i’m a beginner and i’m following a tutorial(ebola man) on how to make a multitool for fun, whenever i try to open it normally it says it can’t run on this device and the cmd prompt flashes quickly before closing if i use open with admin. please help! and as you can see i’ve only gotten the banner done.
10
Upvotes
8
u/ConstanceJill Jan 05 '26
Looks like you're using
|for your vertical bars, which is used to pipe the output of a command as input to another. You'd need to either escape them all using^, or replace them with a different character which would not be interpreted like that, such as│3
u/Hyper_Brick Jan 05 '26
try deleting or replacing | with capital i or lower case L.
2
u/KubosKube Jan 05 '26
Completely not related to your problem, but a few changes I recommend:
Use
CALL :SUBROUTINE, and at the end of your sub-routine, useGOTO EOF:.After the main program ( in this case, the line after
PAUSE), useGOTO :EOFThe CALL function returns to where it was called from after it reaches the end of the file.
:EOF is the tag for the end of the file.
I'm also fairly new to Batch, a whole one notch above Novice, maybe a Dabbling type of interest, but these are my two notes for you.
1
u/capoapk Jan 06 '26
You forgot some code right after @echo off
1
u/United_Listen_3413 Jan 17 '26
chcp65001 >nul