a. Prompt the user for an output location (IP address and shared folder name) and then map a drive letter to that location.
b. The batch file should write a file with the output of all the commands run to the location specified in step ‘a’ above.
c. The batch file should also write to the file the time and date when the batch file was started and completed.
d. The batch file should also write a separate file to the location in step ‘a’ with the md5 and sha1 hashes for the command output file created above.
While my script prompts the user for a directory and IP, the file that is created just goes to the local directory that the batch file was run from. It also does not map the share. I know just enough to be dangerous and no one elsewhere has been willing to help me. Here is what I currently have:
Code: Select all
@ECHO OFF
pause
REM This section prompts user for output location
:start
CLS
set /p direct="Enter the directory output location: "
dir %1 %direct% > investigation.txt
pause
REM
set /p direct="Enter the IP output location: "
dir %1 > investigation.txt
pause
REM Map share
@echo Map Share
@echo off
net use z: \\%1
pause
REM This section appends the date and time of the investigation.
@Echo Date and Time
@Echo off
date /T >> investigation.txt && time /T >> INVESTIGATION.TXT
pause
REM This step creates the MD5 hash
@echo MD5 VALUE
@echo off
MD5DEEP investigation.txt > Hash.txt
pause
REM This step creates the SHA1 hash
echo SHA1 VALUE
@echo off
SHA1DEEP investigation.txt >> Hash.txt
pause