Deus luna
Deus luna

Reputation: 19

How do I "echo" a command in a batch script?

I'm trying to shutdown my PC using a batch script, but when I type "@echo shutdown /r", CMD just displays "shutdown /r" on the screen, instead of doing the command. I'm currently new to batch scripting, so forgive me on my knowledge on the command prompt and batch scripting.

Here is my code (I don't think this will help):

    @echo off 
    title Shutdown.bat
    color 0a
    echo:

    echo Your PC will shutdown (testing).
    pause>nul

    @echo shutdown /r
    pause>nul

Upvotes: 1

Views: 4971

Answers (1)

david
david

Reputation: 93

command echo text show you only text on command line. Use only shutdown /r for shutdown you pc.

Upvotes: 1

Related Questions