Collection of Batch files for everyone to use!

To autorun a memory stick you need a file called autorun.inf
The contents of this file would be as such

[autorun]
label=roys experiment
shellexecute=test.bat

The label will name your memory stick
Then the name of the batch file that will run

If you set the batch file to run an html file then it would be like this.

Main.mht

this allows you to design a main page using word that will execute in you web page viewer.

In short you have an index page like a web page called main.mht that will autorun from the memory stick. The batch file called test.bat calls the file main.mht.

There are alot of things you can do with memory sticks these days.

How do I create the 'Autorun.inf' file? Or is it just a notepad format then save the text doc with the .inf format?

Right now I'm making a batch file with Vista tools, Network tools, and a Information logger. I will also seperate them if only one is needed in the zip. I'll have it posted before tonight for sure. The logger I made works perfect. I also added an option to move all the .txt docs from the desktop into a folder so the user can zip it and upload it, or move the folder where ever for late reference...
 

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
You can do it in notepad. Just ensure you have the tools section of windows explorer set to show extensions so you can change the extension as you want.

Just an idea, you may want the last option of your bat file to run all test. I have not looked at your zip, I will do it now:).
 

My Computer

System One

  • Manufacturer/Model
    Self Built
    CPU
    I5 3570K
    Motherboard
    Gigabyte Z77-DS3H
    Memory
    4 x 4GB corsair ballistix sport DDR3 1600 Mhz
    Graphics card(s)
    Gigabyte Geforce GTX 660 TI
    Sound Card
    creative x-fi
    Monitor(s) Displays
    Primary CiBox 22" Widescreen LCD ,Secondary Dell 22" Widescreen
    Screen Resolution
    Both 1680 x 1050
    Hard Drives
    2 x 500G HD (SATA) 1 x 2TB USB
    PSU
    Corsair HX 620W ATX2.2 Modular SLI Complient PSU
    Case
    Antec 900 Ultimate Gaming Case
    Cooling
    3 x 80mm tri led front, 120mm side 120mm back, 200mm top
    Mouse
    Technika TKOPTM2
    Keyboard
    Logik
    Internet Speed
    288 / 4000
    Other Info
    Creative Inspire 7.1 T7900 Speakers Trust Graphics Tablet
Alright, sounds easy enough.

So in notepad I would name the file autorun.inf, the contents would be:
[autorun]
label=x
shellexecute=anything.bat?

Included in this post are my newest batch files. Please take a look guys :D

Also let me know if there are any bugs or problems with them, I tested each option, but I'm not sure if it won't error on another machine. Thanks for the assistance everyone :)
 

Attachments

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
In the above file attachment I forgot to sort between new and old batch files. The following attachment will have a 'New' folder with my new creations, and an 'Old' folder with 2 other previous attachments...

Sorry for the mistake.
 

Attachments

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
There is a way of getting a batch file to run as administrator when called from a batch file. This may allow you to get everything to run from a menu and not have much needed from the user in way of using the CMD. Runas is the command I have found.

I have not written batch files for over 10 years so looking into this is getting the brain cells warming up and at my age this takes a while.:D

On wireless Utility pack you have no error control. If someone enters a wrong choice, a letter for example then the batch file will go for the first option.

After the IF options include a goto statement to go back to the beggining. This will ensure that only the options listed will be used. You can add an extra line after the if statments.

echo please only choose and option from the menu 1 - 11

to make it a bit more user friendly.

@echo off
Title Windows Network Utilities
goto menu
:menu
echo ***Some of the present utilities may require 'Admin' Privileges***
echo ***If so please exit, the right click the file and select: 'Run as Administrator'***
echo ***Thank you :)***
echo What Would You Like To Do?
echo 1 Display DNS
echo 2 Flush DNS
echo 3 Wireless Signal
echo 4 Ping Your Current Connection
echo 5 Run the 'Ipconfig' utility
echo 6 Show The Driver's of Your Current Connection's Card
echo 7 Show Wired (Lan) Settings
echo 8 Release IPv4 Address (If You Run This You MUST Run 'Renew IPv4 Address')
echo 9 Renew IPv4 Address
echo 10 Release / Renew Automated
echo 11 Quit
:choice
set /P C=[1,2,3,4,5,6,7]?
if '%C%' == '1' goto disdns
if '%C%' == '2' goto clrdns
if '%C%' == '3' goto sig
if '%C%' == '4' goto ping
if '%C%' == '5' goto ip
if '%C%' == '6' goto drv
if '%C%' == '7' goto lan
if '%C%' == '8' goto rel
if '%C%' == '9' goto ren
if '%C%' == '10' goto aut
if '%C%' == '11' goto end
echo please only choose and option from the menu
goto choice
:disdns
ipconfig /displaydns
goto menu
:clrdns
ipconfig /cleardns
goto menu
:sig
netsh wlan show interface
goto menu
:ping
ping localhost
goto menu
:ip
ipconfig /allcompartments /all
goto menu
:drv
netsh wlan show drivers
goto menu
:lan
netsh lan dump
goto menu
:rel
ipconfig /release
goto menu
:ren
ipconfig /renew
goto menu
:aut
ipconfig /release
ipconfig /renew
goto menu

:end
exit

Ignore the smiley on ping
 

My Computer

System One

  • Manufacturer/Model
    Self Built
    CPU
    I5 3570K
    Motherboard
    Gigabyte Z77-DS3H
    Memory
    4 x 4GB corsair ballistix sport DDR3 1600 Mhz
    Graphics card(s)
    Gigabyte Geforce GTX 660 TI
    Sound Card
    creative x-fi
    Monitor(s) Displays
    Primary CiBox 22" Widescreen LCD ,Secondary Dell 22" Widescreen
    Screen Resolution
    Both 1680 x 1050
    Hard Drives
    2 x 500G HD (SATA) 1 x 2TB USB
    PSU
    Corsair HX 620W ATX2.2 Modular SLI Complient PSU
    Case
    Antec 900 Ultimate Gaming Case
    Cooling
    3 x 80mm tri led front, 120mm side 120mm back, 200mm top
    Mouse
    Technika TKOPTM2
    Keyboard
    Logik
    Internet Speed
    288 / 4000
    Other Info
    Creative Inspire 7.1 T7900 Speakers Trust Graphics Tablet
Roy,

Should I add that error statement in every batch file? I didn't even think of that...

Also, I created the autoruns.inf and added it to a flash drive and it's not autorunning my batch file. The batch file is also on the drive..
 

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
I fixed the Wireless utility pack. I seen that I didn't even add the corresponding options with what was listed. eg. I had options 1-11 with only 1-7 choices...

Anyways that's fixed and I also added the "Please Choose an Option From The Above Menu Only" so there isn't any confusion.

Next I'm going to see if I can successfully make these files run as Admin on different machines.

Thanks again for the support. :)
 

Attachments

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
Just thought of this. The command "tree" will show us their directory structure, plus could pipe it to tree.txt. An oldie but a goodie.
 

My Computer

System One

  • Manufacturer/Model
    Custom
    CPU
    AMD AM2 6000+
    Motherboard
    Nvidia M2N-E SLI
    Graphics card(s)
    GeForce 7600GT
    Screen Resolution
    1280x1024
    Hard Drives
    WD
    Case
    Cooler Master
    Cooling
    Three fans
    Mouse
    Dell Optical
    Keyboard
    Dell Quietkey
    Internet Speed
    10 MBPS
Just thought of this. The command "tree" will show us their directory structure, plus could pipe it to tree.txt. An oldie but a goodie.

I was thinking about that yes. This would also show us installed programs I believe, so we could look for unknown extensions or malicious material. I might use the DIR command, it's harder on the eyes, but it lists everything.

Good thinking :)

I'm updating a few batch files now. I'm adding in a message that shows only if the user types something other than the supplied options. I can also add in to my logging.bat file the tree option. In fact, I will lol.


Updates soon :)
 

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
If it ever gets too unwieldy, you could always break out submenus. Not now, but always an option.
 

My Computer

System One

  • Manufacturer/Model
    Custom
    CPU
    AMD AM2 6000+
    Motherboard
    Nvidia M2N-E SLI
    Graphics card(s)
    GeForce 7600GT
    Screen Resolution
    1280x1024
    Hard Drives
    WD
    Case
    Cooler Master
    Cooling
    Three fans
    Mouse
    Dell Optical
    Keyboard
    Dell Quietkey
    Internet Speed
    10 MBPS
If it ever gets too unwieldy, you could always break out submenus. Not now, but always an option.

I already did, its included in my Ultimate Vista Pack. It has everything included in one file with 1 main menu, 3 sub menu's, and a link from each sub menu, back to the main :)

Here are the updates.

Only thing update is the error message. Its "Please Choose A Valid Option" when the user presses something other than the options listed eg [1,2,3,4,5,6,7,8,9]? and the users presses 11 it wont auto run 1 or exit the windows...

Enjoy :)
 

Attachments

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
Again, I was testing everything and I made a few typo's in my 'Logging.bat' file in the last zip I attached. I'm including an update to this post that will fix those typos.

last 'Logging.bat' bugs: if the user types in the option to log the tree, it will only log the desktop folder and it exits the window.

if the user types in the option to log the DIR it only logs the desktop folder then returns to the menu

FIXES with current 'Logging.bat': The option to log the tree will report a log with the whole C:\ drive and then return to the menu.

The option to log a DIR will now report a log of the full C:\ drive.

NOTE: When logging the 'Tree' and 'DIR' notepad will take awhile to load its contents so please be patient.

Sorry for any inconviences.

Enjoy!
 

Attachments

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
Here is another update to my Ultimate Vista Tool batch file. It has a few extra goodies and fixes a typo with my "goto" commands.

Enjoy!

Again, thanks for all the support and requests! :)
 

Attachments

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
For option #2 off the main menu, you need to cls. Looks great and keep up the good work!

I was also thinking of
| more (that's pipe more)
for displays that could run past one screen. Dunno...
 

My Computer

System One

  • Manufacturer/Model
    Custom
    CPU
    AMD AM2 6000+
    Motherboard
    Nvidia M2N-E SLI
    Graphics card(s)
    GeForce 7600GT
    Screen Resolution
    1280x1024
    Hard Drives
    WD
    Case
    Cooler Master
    Cooling
    Three fans
    Mouse
    Dell Optical
    Keyboard
    Dell Quietkey
    Internet Speed
    10 MBPS
For option #2 off the main menu, you need to cls. Looks great and keep up the good work!

I was also thinking of
| more (that's pipe more)
for displays that could run past one screen. Dunno...

I cant cls option #2 because the information is displayed within the prompt so if I cls after the command nothing will display. I already tried and it didn't work out so well haha.

Thanks!
 

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
Here is a copy of my experiment to autorun a webpage from a memory card.
Use it as an example of how to get a batch file running and how to get a web page running.

View attachment Autorun.zip
 

My Computer

System One

  • Manufacturer/Model
    Self Built
    CPU
    I5 3570K
    Motherboard
    Gigabyte Z77-DS3H
    Memory
    4 x 4GB corsair ballistix sport DDR3 1600 Mhz
    Graphics card(s)
    Gigabyte Geforce GTX 660 TI
    Sound Card
    creative x-fi
    Monitor(s) Displays
    Primary CiBox 22" Widescreen LCD ,Secondary Dell 22" Widescreen
    Screen Resolution
    Both 1680 x 1050
    Hard Drives
    2 x 500G HD (SATA) 1 x 2TB USB
    PSU
    Corsair HX 620W ATX2.2 Modular SLI Complient PSU
    Case
    Antec 900 Ultimate Gaming Case
    Cooling
    3 x 80mm tri led front, 120mm side 120mm back, 200mm top
    Mouse
    Technika TKOPTM2
    Keyboard
    Logik
    Internet Speed
    288 / 4000
    Other Info
    Creative Inspire 7.1 T7900 Speakers Trust Graphics Tablet
sorry if i am being a bit slow, but how do you use the batch files once you have downloaded them? double click? i am new to this stuff so please be patient!

Lil' Domii

ok i tried out myself lol
 
Last edited by a moderator:

My Computer

System One

  • Manufacturer/Model
    Acer 5735z Laptop
    CPU
    2.0 ghz intel pentium dual-core processor t4200 800mhz fsb
    Motherboard
    Acer CathedralPeak Rev
    Memory
    4gb
    Graphics card(s)
    Integrated Intel Graphics Media Accelerator 4500
    Sound Card
    Realtek
    Monitor(s) Displays
    15.6" HD CineCrystal LCD
    Screen Resolution
    1366x768
    Hard Drives
    160gb stock drive. ATA
    Case
    Stock Notebook
    Cooling
    Stock
    Mouse
    Synaptics TouchPad
    Keyboard
    PS/2
    Internet Speed
    No idea

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
In this post I'm again updating my Ultimate Vista Pack batch file to 1.2

There is a readme in the zip folder which explains the fixes. :)

@ pacinitaly

I downloaded your .bat file zip and I'm trying to make a safer version of your TMP cleaner. It will only delete files with the .tmp extension. Also, the directories listed in your .bat file are 'Access Denied' on my machine. Oh well lol.

@ roy

I also downloaded your autorun zip folder and I seen your main page, what program did you use to make that? Really neat! :)
 
Last edited:

My Computer

System One

  • Manufacturer/Model
    HP
    CPU
    Intel Neo
    Memory
    2GB
    Graphics card(s)
    Intergrated Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    10.1
    Screen Resolution
    1280 x 800
    Hard Drives
    160GB
    PSU
    Power Adapter
    Case
    It's special, it flips open :)
    Mouse
    Touchpad
    Keyboard
    Acer
    Internet Speed
    Down: 16mb/s Up: 1.6mb/s
    Other Info
    I killed my HP Laptop :'(
Back
Top