Jump to content

Echo problem with .bat file


Recommended Posts

i'm using windows 7 professional. i'm taking a forensics class and for our assignment we have to make a .bat file to run from the command line that will gather some information and save it to a text file. things were going fine for me until i tried to keep the commands from showing up on the command prompt. i looked it up and found and used this command:

@echo off

it was placed at the top of my text. when i ran it, the file created only displayed

ECHO IS OFF
(everything worked as expected before i added the command). the line didn't do what i wanted so i took it out. now every time i run it the file created only says
ECHO IS ON
. here's what my script looks like so far:

set outdrive=%1
set usrinit=%2
echo START DATE and TIME___________________________________________ > %outdrive%\investigation1.txt
date /t >> %outdrive%\investigation1.txt
time /t >> %outdrive%\investigation1.txt
echo SYSTEM INFORMATION____________________________________________ >> %outdrive%\investigation1.txt
systeminfo >> %outdrive%\investigation1.txt
echo >> %outdrive%\investigation1.txt
echo INVESTIGATOR: %usrinit% ______________________________________ >> %outdrive%\investigation1.txt
echo > %outdrive%\investigation1.txt

i tried creating a new script from scratch and it did the same thing. i tried removing all the echo commands from it and it did the same thing. i tried reseting my computer, zilch. so can anyone tell me how i screwed up? and most importantly how to fix it?

outdrive is so that the user can specify what drive the file is to be saved to, and the second parameter is just for the users initals. thank you for any help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy