Introduction: Sytem Information Collector (windows)
Hi there this is my first instructable, Im am Fairly new to batch but have made a good few personal programs with the batch after converting with bat to exe conver.
First im going to tell you abit about this Program so you can get a general idea of what youll be doing, also listed is software i used to convert the batch to exe so it can be run on other computers without displaying all your code.
You can download bat to exe converter here
http://www.f2ko.de/downloads/Bat_To_Exe_Converter.zip
also included in my batch is the speak.exe which is another download from f2ko
download here:
http://www.f2ko.de/Deutsch/cmdtools/speak.exe
The speak option is so users who use this batch can hear what is going on in the back ground and know what is happening with there computer as the batch file runs.
in this batch i also produce a timer which splashes over the screen and informs the user that i will be doing a trace on there system for 60 seconds,so the user doesnt have the urge to start messing around with the files or killing my program before it ends, basically its just to keep them busy looking at the clock instead of doing alternate stuff while the program runs after which i kill the timer and delete it. then they will be listening intently to the speak.exe which is telling them more info.
ok so now for the first bit of code.
Step 1: The First Batch Part
:CODEBEGIN
@echo off
speak.exe Deleting old logs
DEL /Q %USERNAME% systeminf %date%.txt
DEL /Q %USERNAME% Paste here.txt
DEL /Q %userprofile%\Documents\"%USERNAME% Paste here.txt
DEL /Q priv8tepir8te-report.html
DEL /Q energy-report.html
DEL /Q %homedrive%\Windows\System32\energy-report.html
DEL /Q %TEMP%\"%USERNAME% information.txt"
SPEAK.exe Any old logs have been deleted
:CODEEND
:EXPLAINED
Ok i was going to just paste the whole thing on here but for those who are really new to batch i will explain a little more on each command as we go through but if you are already in the know just skip to the end of this instructable for the code and links .
:SPEAK.EXE
speak.exe is the file you should of downloaded a minute ago it is a file made for the use of cmd which with a batch file will talk to the user via there speakers whatever you have typed in the batch file the user will hear ,the file must be in the same folder as the batch for easy use or installed in the system32 folder for long term use, simply copy to windows/ system32 .It can be used hidden and will speak in the default voice on the pc.
Usage is as simple as speak.exe my name is "name"
:DEL
Del is used in a batch to delete a cetain file or folder.
so you can see from the code that i am informing the user i am deleting old logs then after deleting the logs i inform them i have deleted them
click next step for more
@echo off
speak.exe Deleting old logs
DEL /Q %USERNAME% systeminf %date%.txt
DEL /Q %USERNAME% Paste here.txt
DEL /Q %userprofile%\Documents\"%USERNAME% Paste here.txt
DEL /Q priv8tepir8te-report.html
DEL /Q energy-report.html
DEL /Q %homedrive%\Windows\System32\energy-report.html
DEL /Q %TEMP%\"%USERNAME% information.txt"
SPEAK.exe Any old logs have been deleted
:CODEEND
:EXPLAINED
Ok i was going to just paste the whole thing on here but for those who are really new to batch i will explain a little more on each command as we go through but if you are already in the know just skip to the end of this instructable for the code and links .
:SPEAK.EXE
speak.exe is the file you should of downloaded a minute ago it is a file made for the use of cmd which with a batch file will talk to the user via there speakers whatever you have typed in the batch file the user will hear ,the file must be in the same folder as the batch for easy use or installed in the system32 folder for long term use, simply copy to windows/ system32 .It can be used hidden and will speak in the default voice on the pc.
Usage is as simple as speak.exe my name is "name"
:DEL
Del is used in a batch to delete a cetain file or folder.
so you can see from the code that i am informing the user i am deleting old logs then after deleting the logs i inform them i have deleted them
click next step for more
Step 2: More Code
:CODEBEGIN
cls
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo PRIV8TEPIR8TE SYSTEM INFO 2010 >>%TEMP%\"%USERNAME% information.txt"
echo (Collection for %username%) >>%TEMP%\"%USERNAME% information.txt"
echo %date% %time% >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo. >>%TEMP%\"%USERNAME% information.txt"
echo. >>%TEMP%\"%USERNAME% information.txt"
speak.exe observing %username%'s system behaiviour for sixty seconds or more,thank you %username%,for being patient.
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Power Configuration on %username%'s pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo. >>%TEMP%\"%USERNAME% information.txt"
msg * Priv8tepir8te is observing your system behaviour for 60 seconds, tracing please wait, A log will be opened after it has been compiled.
echo Power configuration completed, result printed to a html document and opened >>%TEMP%\"%USERNAME% information.txt"
ren timer.cmd timer.exe
start timer.exe
speak.exe The timer will close when a report has been collected.
POWERCFG -energy
echo .>>%TEMP%\"%USERNAME% information.txt"
:CODEEND
Ok this is a more complexed part to explain so please keep your witts about you so we dont end up confused and give up.
:ECHO
echo is a command we use to echo information to a user but instead of us echo-ing in a black box were going to echo our information to a text document instead, we do this by telling the command to echo our information to a text document instead, we can also echo in html aswell but it becomes more complicated but more on that later on in our instructablle An example of echo-ing to txt is as follows
echo %date% >>%USERPROFILE%\Desktop\Thedateis.txt
will print %date% to the users profiles desktop to a text document called thedateis.txt
as you see with this part of code above is mostly echo-ing and speaking, it seems weve done alot aready but not very much has happend as we havent told the cmd console to do anything but talk and write so the next important part of the code is timer part, please note that when i made this i made it with the instuctable in mind and wanted an instuctable to shared the tricks i use when i make batch files so with that in mind when the timer is running it is running as timer.(exe) but you will see in the batch it is also called timer.(cmd) this is so that if people snoop they will wonder what timer.(cmd) is and open in notepad to read but in reality its an exe file so during the batch i simply re-name it back to its original name timer.(exe) the :REN command is really cool when using batch.
We also have the ( msg *) command in this part of the batch file, When we type msg * we tell the computer to display a message.
eg:
msg * your name is %username%
The next part we tell the batch tell the command console to collect power infomation about the computer we run the batch file on, we do this using the POWERCFG command (for more power options type POWERCFG /? in a command prompt box.
remember there is no echo before the POWERCFG command.
In this case were telling the computer to collect information about our energy setting , this command will collect detailed info on your energy then produce a html document called energy-report.html, the report takes 60 seconds to compile and build so thats how long we have the timer open.
Click next step
Step 3: After Power Collection
:CODEBEGIN
speak.exe Collecting memory information.
ren energy-report.html priv8tepir8te-report.html
taskkill /im timer.exe /f
ren timer.exe timer.cmd
del timer.cmd /f
speak.exe Power Configuration log has been built
echo "
" >>priv8tepir8te-report.html
echo "
" >>priv8tepir8te-report.html
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo system information on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
whoami >>%TEMP%\"%USERNAME% information.txt"
slmgr.vbs -dli >>%TEMP%\"%USERNAME% information.txt"
slmgr.vbs -dti >>%TEMP%\"%USERNAME% information.txt"
slmgr.vbs -xpr >>%TEMP%\"%USERNAME% information.txt"
ver >>%TEMP%\"%USERNAME% information.txt"
systeminfo >>%TEMP%\"%USERNAME% information.txt"
speak.exe system information collected, Printing Results.
speak.exe Proceeding to Memory Information.
speak.exe gathering data.
echo . >>%TEMP%\"%USERNAME% information.txt"
:CODEEND
In this part of the batch file we havepreviously asked the computer to collect power information which it has done, we have diplayed a timer for 60 seconds while it built a power report in html. You will see that when the computer has collected this info an built a log it will proceed to the next step in the batch file which is to tell the user were collecting memory information, we then kill the timers process by using the (Taskkill) Command. when we use the taskkill command we are telling the computer to kill a certain task we know is running, in this case we tell the computer to kill the image (/im) of our process timer.exe. The /f on the end is to tell the computer to force the image to close
Taskkill /im explorer.exe /f will kill the image explorer.exe in a forceful way.
then we rename the timer.(exe) back to timer.(cmd) incase we dont want people snooping but we can also delete it after to be sure as above.
So we know that a Power log is now built and the default name of the log is energy-report.html so we use the REN command again to rename it to whatever we like,ive renamed my power report to priv8tepir8te-report.html.
Then as i mentioned earlier we can also echo to html aswell as txt,rtf,doc ect infact we can echo to pretty much any readable document which is good to know . but to echo to html we need to know some html commands, Im not to great with html so i just printed some basic stuff to make the report my own, please note anything you print will print the text at the bottom of the document, so now that we have our power report built we can continue collecting the rest of the information.
Next we call the (whoami) command which will dispay who the user is and on what computer which is printed to the text document.
Then we use the Software Licence Manager.vbs (slmgr.vbs) which is on every windows computer we call slmgr.vbs - (dli) which displays licence information
we call slmgr.vbs -(dti) which displays the installation id
then slmgr.vbs -(xpr) which diplays the expiration date of the current windows key.
we then use the command (VER) which diplays the windows version
Bearing in mind were not displaying this were echo-ing to text, next were using the (SYSTEMINFO) command which diplays alot of system information and were also using speak.exe to tell the user what were doing as or before were doing it.
press next to the goto the next step
speak.exe Collecting memory information.
ren energy-report.html priv8tepir8te-report.html
taskkill /im timer.exe /f
ren timer.exe timer.cmd
del timer.cmd /f
speak.exe Power Configuration log has been built
echo "
" >>priv8tepir8te-report.html
echo "
" >>priv8tepir8te-report.html
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo system information on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
whoami >>%TEMP%\"%USERNAME% information.txt"
slmgr.vbs -dli >>%TEMP%\"%USERNAME% information.txt"
slmgr.vbs -dti >>%TEMP%\"%USERNAME% information.txt"
slmgr.vbs -xpr >>%TEMP%\"%USERNAME% information.txt"
ver >>%TEMP%\"%USERNAME% information.txt"
systeminfo >>%TEMP%\"%USERNAME% information.txt"
speak.exe system information collected, Printing Results.
speak.exe Proceeding to Memory Information.
speak.exe gathering data.
echo . >>%TEMP%\"%USERNAME% information.txt"
:CODEEND
In this part of the batch file we havepreviously asked the computer to collect power information which it has done, we have diplayed a timer for 60 seconds while it built a power report in html. You will see that when the computer has collected this info an built a log it will proceed to the next step in the batch file which is to tell the user were collecting memory information, we then kill the timers process by using the (Taskkill) Command. when we use the taskkill command we are telling the computer to kill a certain task we know is running, in this case we tell the computer to kill the image (/im) of our process timer.exe. The /f on the end is to tell the computer to force the image to close
Taskkill /im explorer.exe /f will kill the image explorer.exe in a forceful way.
then we rename the timer.(exe) back to timer.(cmd) incase we dont want people snooping but we can also delete it after to be sure as above.
So we know that a Power log is now built and the default name of the log is energy-report.html so we use the REN command again to rename it to whatever we like,ive renamed my power report to priv8tepir8te-report.html.
Then as i mentioned earlier we can also echo to html aswell as txt,rtf,doc ect infact we can echo to pretty much any readable document which is good to know . but to echo to html we need to know some html commands, Im not to great with html so i just printed some basic stuff to make the report my own, please note anything you print will print the text at the bottom of the document, so now that we have our power report built we can continue collecting the rest of the information.
Next we call the (whoami) command which will dispay who the user is and on what computer which is printed to the text document.
Then we use the Software Licence Manager.vbs (slmgr.vbs) which is on every windows computer we call slmgr.vbs - (dli) which displays licence information
we call slmgr.vbs -(dti) which displays the installation id
then slmgr.vbs -(xpr) which diplays the expiration date of the current windows key.
we then use the command (VER) which diplays the windows version
Bearing in mind were not displaying this were echo-ing to text, next were using the (SYSTEMINFO) command which diplays alot of system information and were also using speak.exe to tell the user what were doing as or before were doing it.
press next to the goto the next step
Step 4: Sheduled Tasks and Memory
:CODEBEGIN
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Sheduled Task for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
speak.exe collecting sheduled tasks for %username%
SCHTASKS >>%TEMP%\"%USERNAME% information.txt"
speak sheduled tasks Collected.
echo . >>%TEMP%\"%USERNAME% information.txt" >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Memory usage for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo memory details listed below >>%TEMP%\"%USERNAME% information.txt"
speak.exe collecting memory for %username%
mem >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Memory Debuging info usage for %username%'s >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
mem.exe /D >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Memory Classification info usage >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
mem.exe /C >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
speak.exe Memory information collected
speak.exe Collecting Other running processes for, %username% on %date%
:CODEEND
Right, so we looked at the things we can do with printing information,building power logs and product key details but were bearly breaking ice here, there is so much more command can do than displayed here in this instructable but what id like to get accross is that the command system is on every windows console and is hardly ever used any more, i didnt use it until last month now i abuse it daily , testing its bounderied and limitations, trying new things, learning everything i can because its so powerful, its ridiculasly easy when you learn and its a powerful tool not to be taken lightly, ive seen many instructable where people just take the piss and delete other peoples files as a virus, fair enuff your using command but you could do so much more and i want to start a chain of fresh new batch files that are powerful and also fun. sorry my quick rant there, just had to say...
So now were asking the command to collect shedule task on the users computer, we do that using the SCHTASKS command and again we asking the command to print it to our text file.
Were also doing exactly the same with the Mem command and telling the user what were doing in the process.
(type mem /?) in a command prompt box for more infomation.
Click next for the next part of the instructable.
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Sheduled Task for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
speak.exe collecting sheduled tasks for %username%
SCHTASKS >>%TEMP%\"%USERNAME% information.txt"
speak sheduled tasks Collected.
echo . >>%TEMP%\"%USERNAME% information.txt" >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Memory usage for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo memory details listed below >>%TEMP%\"%USERNAME% information.txt"
speak.exe collecting memory for %username%
mem >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Memory Debuging info usage for %username%'s >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
mem.exe /D >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Memory Classification info usage >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
mem.exe /C >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
speak.exe Memory information collected
speak.exe Collecting Other running processes for, %username% on %date%
:CODEEND
Right, so we looked at the things we can do with printing information,building power logs and product key details but were bearly breaking ice here, there is so much more command can do than displayed here in this instructable but what id like to get accross is that the command system is on every windows console and is hardly ever used any more, i didnt use it until last month now i abuse it daily , testing its bounderied and limitations, trying new things, learning everything i can because its so powerful, its ridiculasly easy when you learn and its a powerful tool not to be taken lightly, ive seen many instructable where people just take the piss and delete other peoples files as a virus, fair enuff your using command but you could do so much more and i want to start a chain of fresh new batch files that are powerful and also fun. sorry my quick rant there, just had to say...
So now were asking the command to collect shedule task on the users computer, we do that using the SCHTASKS command and again we asking the command to print it to our text file.
Were also doing exactly the same with the Mem command and telling the user what were doing in the process.
(type mem /?) in a command prompt box for more infomation.
Click next for the next part of the instructable.
Step 5: Running Process,mac Details, Mode and Drivers
:CODEBEGIN
echo
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Running processes on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe running processes collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
tasklist >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Mac Details on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe mac details collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
getmac.exe >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Mode on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe Mode collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
mode >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Drivers on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe Drivers Information collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
driverquery /fo csv >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
speak.exe If your internet is running %username%'then This process will take some time,please be patient,thank you!
speak.exe scanning network connections.
:CODEEND
Here we are looking at running process,mac details, mode and drivers
We are using simple easy commands as we have been but making it look complexed and difficult, just think how cool you newbies will look showing your friends your batch files in progress and the results it harvests for you, but the error here is that no-matter how much you claim it it was never really your work, and i dont mid sharing it with you for you to say it yours, i couldnt care really ,you have to learn somewhere and this is a great start for you,the gratification comes from when you build and compile your own application without copying code from all over the shop,and it doesnt matter what anyone else thinks cuz its your work and its great and dontl let anyone else say otherwise. Learning is key tho. anyway back to work, were using the (taks) command again, remember earlier we used taskkill well now were using (tasklist) which will diplay a list of running tasks on your computer but remember were printing them to text not displaying.
Then we move to getmace.exe which list all mac details and prints them and this is the same with mode and driverqueiry..
for more info type the command with /? at the end in a command propt box
echo
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Running processes on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe running processes collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
tasklist >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Mac Details on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe mac details collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
getmac.exe >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Mode on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe Mode collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
mode >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Drivers on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe Drivers Information collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
driverquery /fo csv >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
speak.exe If your internet is running %username%'then This process will take some time,please be patient,thank you!
speak.exe scanning network connections.
:CODEEND
Here we are looking at running process,mac details, mode and drivers
We are using simple easy commands as we have been but making it look complexed and difficult, just think how cool you newbies will look showing your friends your batch files in progress and the results it harvests for you, but the error here is that no-matter how much you claim it it was never really your work, and i dont mid sharing it with you for you to say it yours, i couldnt care really ,you have to learn somewhere and this is a great start for you,the gratification comes from when you build and compile your own application without copying code from all over the shop,and it doesnt matter what anyone else thinks cuz its your work and its great and dontl let anyone else say otherwise. Learning is key tho. anyway back to work, were using the (taks) command again, remember earlier we used taskkill well now were using (tasklist) which will diplay a list of running tasks on your computer but remember were printing them to text not displaying.
Then we move to getmace.exe which list all mac details and prints them and this is the same with mode and driverqueiry..
for more info type the command with /? at the end in a command propt box
Step 6: Last Step Learn
:CODEBEGIN
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Active Conections on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
Netstat /a >>%TEMP%\"%USERNAME% information.txt"
speak.exe Active Connections collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Network Configuration for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo %Username%'s Operating system is %os% on %date% %time% >>%TEMP%\"%USERNAME% information.txt"
ipconfig /all >>%TEMP%\"%USERNAME% information.txt"
echo .>>%TEMP%\"%USERNAME% information.txt"
speak.exe Network information Data Collected or %username%
echo All compartments Below for %username%>>%TEMP%\"%USERNAME% information.txt"
ipconfig /allcompartments /all >>%TEMP%\"%USERNAME% information.txt"
speak.exe More network Data Collected, Printing results
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Wireless info for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh wlan show all >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Shared Wireless credentials for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh wlan show allowexplicitcreds >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Wireless Profiles for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh wlan show profiles >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Wireless issues for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh wlan reportissues >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Network Interfaces, Windows Firewall >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe Network Interfaces collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh show helper >>%TEMP%\"%USERNAME% information.txt"
netsh show Alias >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Boot Configuration on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe Boot Information collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
bcdedit >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Shadow Copieds %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
ECHO . >>%TEMP%\"%USERNAME% information.txt"
speak.exe Shadow copy Information can take a moment to collect please wait.
vol >>%TEMP%\"%USERNAME% information.txt"
vssadmin List ShadowStorage >>%TEMP%\"%USERNAME% information.txt"
echo ................................................................>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo providers Below >>%TEMP%\"%USERNAME% information.txt"
echo ................................................................>>%TEMP%\"%USERNAME% information.txt"
vssadmin List Providers >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Shadows Below >>%TEMP%\"%USERNAME% information.txt"
echo ................................................................>>%TEMP%\"%USERNAME% information.txt"
vssadmin List Shadows >>%TEMP%\"%USERNAME% information.txt"
echo Listing writers Below >>%TEMP%\"%USERNAME% information.txt"
echo ................................................................>>%TEMP%\"%USERNAME% information.txt"
vssadmin list writers >>%TEMP%\"%USERNAME% information.txt"
echo Listing providers Below on >>%TEMP%\"%USERNAME% information.txt"
echo ................................................ >>%TEMP%\"%USERNAME% information.txt"
vssadmin list providers >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Back up's on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
ECHO . >>%TEMP%\"%USERNAME% information.txt"
wbadmin get versions >>%TEMP%\"%USERNAME% information.txt"
ECHO . >>%TEMP%\"%USERNAME% information.txt"
wbadmin items >>%TEMP%\"%USERNAME% information.txt"
ECHO . >>%TEMP%\"%USERNAME% information.txt"
wbadmin get status >>%TEMP%\"%USERNAME% information.txt"
speak.exe Shadow copy and back ups Information collected, Printing Results.
ECHO Thank you for %username% for using my application craig bird %date% >>%TEMP%\"%USERNAME% information.txt"
if not exist priv8tepir8te-report.html goto missing
:next
msg * the power has been built please choose to save it somewhere else it will be deleted.
speak.exe Power configuration report collected,opening the power log
goto fin
:missing
msg * for some reason the log has not been compiled on your power configuration, maybe you need to run this application as administrator.
speak.exe For some reason the log does not exist, you need to run this application in admin mode, opening the other log for %username%
:fin
start /wait priv8tepir8te-report.html
CLIP < %TEMP%\"%USERNAME% information.txt"
DEL /Q %TEMP%\"%USERNAME% information.txt"
speak.exe %USERNAME% Craig has copied further information about your computer to the clipboard for you, to view it click paste on any text reader such as notepad
MSG * %USERNAME% Craig has copied further information about your computer to the clipboard for you, to view it click paste on any text reader such as notepad
speak.exe All logs have been opened, closing application
:exit
END
:CODEEND
This is the last part of the instructable, lets hope by this point you have learned some new tricks and maybe give you some idea of an instuctable you could make.
Here were doing the same as weve done all the way through, we start at the netstat which collects various network informationand is to detailed to list so you understand (for more infor type netstat /? into a command propt box) we then us the command ipconfig /all which displays all basic network info. then we look at boot configuration shadow copied,system back ups and the clip command which i wont explain about as your taks now is to go and find out about these things for yourself, you have learned a considerable amount and now have a good understanding of how command work and what you can do. if you have any question or comments then feel free to post, thank you for taking your time and enjoy the instructable....
good luck
craig bird
:note when you download the files you need to rename them
rename system info .tmp to system info.exe
rename collect command.tmp collect.cmd
rename battoexe.tmp battoexe.exe
rename speak.tmp to speak.exe
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Active Conections on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
Netstat /a >>%TEMP%\"%USERNAME% information.txt"
speak.exe Active Connections collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Network Configuration for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo %Username%'s Operating system is %os% on %date% %time% >>%TEMP%\"%USERNAME% information.txt"
ipconfig /all >>%TEMP%\"%USERNAME% information.txt"
echo .>>%TEMP%\"%USERNAME% information.txt"
speak.exe Network information Data Collected or %username%
echo All compartments Below for %username%>>%TEMP%\"%USERNAME% information.txt"
ipconfig /allcompartments /all >>%TEMP%\"%USERNAME% information.txt"
speak.exe More network Data Collected, Printing results
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Wireless info for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh wlan show all >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Shared Wireless credentials for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh wlan show allowexplicitcreds >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Wireless Profiles for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh wlan show profiles >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Wireless issues for %username%'s Pc >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh wlan reportissues >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Network Interfaces, Windows Firewall >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe Network Interfaces collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
netsh show helper >>%TEMP%\"%USERNAME% information.txt"
netsh show Alias >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Boot Configuration on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
speak.exe Boot Information collected, Printing Results.
echo . >>%TEMP%\"%USERNAME% information.txt"
bcdedit >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Shadow Copieds %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
ECHO . >>%TEMP%\"%USERNAME% information.txt"
speak.exe Shadow copy Information can take a moment to collect please wait.
vol >>%TEMP%\"%USERNAME% information.txt"
vssadmin List ShadowStorage >>%TEMP%\"%USERNAME% information.txt"
echo ................................................................>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo providers Below >>%TEMP%\"%USERNAME% information.txt"
echo ................................................................>>%TEMP%\"%USERNAME% information.txt"
vssadmin List Providers >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Shadows Below >>%TEMP%\"%USERNAME% information.txt"
echo ................................................................>>%TEMP%\"%USERNAME% information.txt"
vssadmin List Shadows >>%TEMP%\"%USERNAME% information.txt"
echo Listing writers Below >>%TEMP%\"%USERNAME% information.txt"
echo ................................................................>>%TEMP%\"%USERNAME% information.txt"
vssadmin list writers >>%TEMP%\"%USERNAME% information.txt"
echo Listing providers Below on >>%TEMP%\"%USERNAME% information.txt"
echo ................................................ >>%TEMP%\"%USERNAME% information.txt"
vssadmin list providers >>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
echo . >>%TEMP%\"%USERNAME% information.txt"
echo Back up's on %username%'s PC >>%TEMP%\"%USERNAME% information.txt"
echo _________________________________________________>>%TEMP%\"%USERNAME% information.txt"
ECHO . >>%TEMP%\"%USERNAME% information.txt"
wbadmin get versions >>%TEMP%\"%USERNAME% information.txt"
ECHO . >>%TEMP%\"%USERNAME% information.txt"
wbadmin items >>%TEMP%\"%USERNAME% information.txt"
ECHO . >>%TEMP%\"%USERNAME% information.txt"
wbadmin get status >>%TEMP%\"%USERNAME% information.txt"
speak.exe Shadow copy and back ups Information collected, Printing Results.
ECHO Thank you for %username% for using my application craig bird %date% >>%TEMP%\"%USERNAME% information.txt"
if not exist priv8tepir8te-report.html goto missing
:next
msg * the power has been built please choose to save it somewhere else it will be deleted.
speak.exe Power configuration report collected,opening the power log
goto fin
:missing
msg * for some reason the log has not been compiled on your power configuration, maybe you need to run this application as administrator.
speak.exe For some reason the log does not exist, you need to run this application in admin mode, opening the other log for %username%
:fin
start /wait priv8tepir8te-report.html
CLIP < %TEMP%\"%USERNAME% information.txt"
DEL /Q %TEMP%\"%USERNAME% information.txt"
speak.exe %USERNAME% Craig has copied further information about your computer to the clipboard for you, to view it click paste on any text reader such as notepad
MSG * %USERNAME% Craig has copied further information about your computer to the clipboard for you, to view it click paste on any text reader such as notepad
speak.exe All logs have been opened, closing application
:exit
END
:CODEEND
This is the last part of the instructable, lets hope by this point you have learned some new tricks and maybe give you some idea of an instuctable you could make.
Here were doing the same as weve done all the way through, we start at the netstat which collects various network informationand is to detailed to list so you understand (for more infor type netstat /? into a command propt box) we then us the command ipconfig /all which displays all basic network info. then we look at boot configuration shadow copied,system back ups and the clip command which i wont explain about as your taks now is to go and find out about these things for yourself, you have learned a considerable amount and now have a good understanding of how command work and what you can do. if you have any question or comments then feel free to post, thank you for taking your time and enjoy the instructable....
good luck
craig bird
:note when you download the files you need to rename them
rename system info .tmp to system info.exe
rename collect command.tmp collect.cmd
rename battoexe.tmp battoexe.exe
rename speak.tmp to speak.exe