Widget
01-28-2008, 05:06 AM
It's just a little nifty batch file that I made a few years back but still works. Here's how to do it:
If you have a flash drive, you can do this at home to look a bit less suspicious or whatever you feel like using as an excuse
Anyway, open up Notepad or Wordpad, and type/paste the following
@echo off
:start
set /p pie=%cd%^>
%pie%
goto start
Now File > Save and type in "cmd.bat" (with the quotes, this over-rides the regular .txt extension so it's actually usable :)) wherever you want to put it (most schools let you save stuff inside My Documents regardless of if you have a network drive).
Just so I can force you to learn something, this is what it does, line by line:
@echo off
Turns echoing off. Basically it stops the commands that it's executing from showing up in the prompt. It's more or less to make it look much nicer :)
:start
This is a label, you'll see later that it lets us come back to this section if we want.
set /p pie=%cd%^>
Big line :p. set /p means we're setting a variable through a prompt. The variable we're setting is pie, and the prompt being displayed is %cd%^>. %cd% will tell you the current directory, and ^> is a > (the ^ is an escape character, it just tells the command prompt to not try executing the > that's following it).
%pie%
Whatever you entered in the prompt will be executed as if it were typed normally. Pretty simple.
goto start
This puts the file into a loop so you can execute commands over and over and keep the current directory and stuff.
Well that's it, you can try net sending or shutdown /i-ing at your own risk ;)
-Widget
If you have a flash drive, you can do this at home to look a bit less suspicious or whatever you feel like using as an excuse
Anyway, open up Notepad or Wordpad, and type/paste the following
@echo off
:start
set /p pie=%cd%^>
%pie%
goto start
Now File > Save and type in "cmd.bat" (with the quotes, this over-rides the regular .txt extension so it's actually usable :)) wherever you want to put it (most schools let you save stuff inside My Documents regardless of if you have a network drive).
Just so I can force you to learn something, this is what it does, line by line:
@echo off
Turns echoing off. Basically it stops the commands that it's executing from showing up in the prompt. It's more or less to make it look much nicer :)
:start
This is a label, you'll see later that it lets us come back to this section if we want.
set /p pie=%cd%^>
Big line :p. set /p means we're setting a variable through a prompt. The variable we're setting is pie, and the prompt being displayed is %cd%^>. %cd% will tell you the current directory, and ^> is a > (the ^ is an escape character, it just tells the command prompt to not try executing the > that's following it).
%pie%
Whatever you entered in the prompt will be executed as if it were typed normally. Pretty simple.
goto start
This puts the file into a loop so you can execute commands over and over and keep the current directory and stuff.
Well that's it, you can try net sending or shutdown /i-ing at your own risk ;)
-Widget