1

The following script works as expected:

echo off

REM This script is designed to demonstrate capture of volatile data from a Post Windows XP client 

date /T > c:/Users/Jon/Desktop/file.txt
time /T >> c:/Users/Jon/Desktop/file.txt
getmac >> c:/Users/Jon/Desktop/file.txt
hostname >> c:/Users/Jon/Desktop/file.txt
ipconfig /all >> c:/Users/Jon/Desktop/file.txt
arp -a >> c:/Users/Jon/Desktop/file.txt
ipconfig /displaydns >> c:/Users/Jon/Desktop/file.txt
netstat -an >> c:/Users/Jon/Desktop/file.txt

However, when a user input for the location of the output file is added :

echo off

REM This script is designed to demonstrate capture of volatile data from a Post Windows XP client 

set /p path="Enter Drive Letter "
date /T > %path%:file.txt
time /T >> %path%:file.txt
getmac >> %path%:file.txt
hostname >> %path%:file.txt
ipconfig /all >> %path%:file.txt
arp -a >> %path%:file.txt
ipconfig /displaydns >> %path%:file.txt
netstat -an >> %path%:file.txt

an error is returned that the commands are not valid commands except for Date and Time which are exported as expected into %path%:file.txt

Please may I have some advice to resolve this issue?

Many Thanks

Jon

1 Answer 1

2

path variable is used to enumerate the folders where executable files will be searched for. If you overwrite it, only internal commands will be available (unless you include the full path in the call)

To solve the problem just use a different variable name.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.