I am writing a very basic batch script to run an MD5 hash. I need it to ask the user for an output directory, then ask for an IP address output, then map a drive letter to this output. I can get it to ask, but it doesn't output the file to the chosen directory. It puts it in the local directory the script was run from. It also won't map a drive letter to it.Can anyone help me fix this? The MD5 hash should be sent to the user chosen directory.
@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
%1
is used for. It is a parameter passed to the batch file when you call it.