Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does the batch file crash?
    primarykey
    data
    text
    <p>I'm designing a chat for my school LAN network, it types your messages into a .dll file so as to disguise the chat log.</p> <p>The problem is that all of a sudden, whenever I started typing messages which have a space in them, the batch file crashes. For example if I enter the message as "h h" the batch will crash with the error:</p> <blockquote> <p>h==exit was unexpected at this time</p> </blockquote> <p>Heres the script: </p> <pre><code>@echo off CLS COLOR f2 SET user=%username% SET message= IF %user%==Josh SET cuser=Miltzi &amp; GOTO :admin IF %user%==miltzj SET cuser=Miltzi &amp; GOTO :admin IF %user%==steinj SET cuser=Jarod &amp; GOTO :first IF %user%==steinda SET cuser=Daniel &amp; GOTO :first IF %user%==rubine SET cuser=Evan &amp; GOTO :first IF %user%==sklairn SET cuser=Nathan &amp; GOTO :first IF %user%==portnoyc SET cuser=Craig &amp; GOTO :first IF %user%==polakowa SET cuser=Polly &amp; GOTO :first IF %user%==selbya SET cuser=Alex &amp; GOTO :first IF %user%==vanderwesthuizenl SET cuser=Lance &amp; GOTO :first msg * This is a test message! :D REM the above line is incase a teacher runs the chat remotely from their computer exit :CHAT TITLE Grade 11 IT chat :) IF NOT EXIST C:\users\Josh\desktop\1.dll echo Chat cleared. &gt;&gt; C:\users\Josh\desktop\1.dll CLS type C:\users\Josh\desktop\1.dll SET /P message=Type message and press enter (Type help to view chat options): IF ERRORLEVEL 1 GOTO :CHAT IF %message%==exit GOTO :exit IF %message%==Exit GOTO :exit IF %message%==EXIT GOTO :exit IF %message%=="exit" GOTO :exit IF %message%==help GOTO :help IF %message%==Help GOTO :help IF %message%=="help" GOTO :help echo %user%: %message% &gt;&gt; C:\users\Josh\desktop\1.dll GOTO :CHAT :exit CLS echo %user% left the chat. &gt;&gt; C:\users\Josh\desktop\1.dll exit :help CLS echo Welcome to the help section echo To exit the chat, please type exit as a message into the chat rather than closing the cmd box manually. echo To refresh the chats messages, just press enter without writing any text. echo Please press enter to go back to the chat :) pause GOTO :CHAT :ACHAT TITLE Grade 11 IT chat :) IF NOT EXIST C:\users\Josh\desktop\1.dll echo Chat cleared. &gt;&gt; C:\users\Josh\desktop\1.dll CLS type C:\users\Josh\desktop\1.dll SET /P message=Type message and press enter (Type help to view chat options): IF ERRORLEVEL 1 GOTO :ACHAT IF %message%==exit GOTO :exit IF %message%==Exit GOTO :exit IF %message%==EXIT GOTO :exit IF %message%=="exit" GOTO :exit IF %message%==help GOTO :help IF %message%==Help GOTO :help IF %message%=="help" GOTO :help IF %message%==cls GOTO :CLS echo %user%: %message% &gt;&gt; C:\users\Josh\desktop\1.dll GOTO :CHAT :exit CLS echo %user% left the chat. &gt;&gt; C:\users\Josh\desktop\1.dll exit :help CLS echo Welcome to the help section echo To exit the chat, please type exit as a message into the chat rather than closing the cmd box manually. echo To refresh the chats messages, just press enter without writing any text. echo Please press enter to go back to the chat :) pause GOTO :CHAT :CLS del C:\users\Josh\desktop\1.dll GOTO :ACHAT :admin echo %user% joined the chat. &gt;&gt; C:\users\Josh\desktop\1.dll GOTO :ACHAT :first echo %user% joined the chat. &gt;&gt; C:\users\Josh\desktop\1.dll GOTO :CHAT exit </code></pre> <p>Any help would be appreciated!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload