My version of a .bat OS with my windows 7

Associate
Joined
12 Aug 2015
Posts
33
Location
US
So I got this project for my laptop I'm working on... still working out details but I started a post about it here:

https://forums.overclockers.co.uk/showthread.php?p=29078842#post29078842

So I figured after tinkering with this I thought I would share my .bat file with everyone who is interested and maybe give some suggestions... right now I'm trying to see if I can like automate a login into this forum and making it so I can just type my username and password in my .bat... anyone have any ideas? Here is my .bat:

NOTE: I SLIGHTLY Altered the code on this because it had sites and passwords I didn't want to show but if you have any questions please ask.

Code:
@echo off

start ACCESS.ahk
start AutoHideMouseCursor_x64.exe

:CYCLE
cls
color 03

For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)

echo.
echo.------------------------------------------------------
echo. MAIN MENU                        %mydate% %mytime%
echo.------------------------------------------------------
@echo off
echo.
echo. 1.Truecrypt                      19.CONFIG SETTINGS                  
echo. 2.Games                          20.Control Panel
echo. 3.Internet Search                21.Volume Control
echo. 4.View Available Networks        22.Manage Wireless Networks
echo. 5.Command Prompt                 23.Tor
echo. 6.Virtual Router                 24.Music Playlist
echo. 7.Media Player Classic           25.Clear Running Programs
echo. 8.Imgburn                        26.Network Discovery
echo. 9.???                            27.Notes
echo. 10.CCleaner                      28.Test Connectivity
echo. 11.Disconnect From Network       29.Movie /Anime List
echo. 12.ConvertXtoDVD                 30.MBAM
echo. 13.MasterSeeker                  31.Youtube Search
echo. 14.GIMP 2.8                  
echo. 15.Revo Uninstaller                    
echo. 16.SUPER Converter              
echo. 17.Websites            
echo. 18.Battery /Power Options                           
echo.
echo.------------------------------------------------------
echo. DRIVES CAN BE SEEN BY TYPING "drives"
echo.------------------------------------------------------
echo.
echo. SELECT DESTINATION:
set /p "pass=>"



if %pass%==1 goto TRUECRYPT
if %pass%==2 goto GAME
if %pass%==3 goto FIREFOX
if %pass%==4 goto VAN
if %pass%==5 goto CMD
if %pass%==6 goto VIRT
if %pass%==7 goto MPC
if %pass%==8 goto IMGB
if %pass%==9 goto ????
if %pass%==10 goto CCLEANER
if %pass%==11 goto DIS
if %pass%==12 goto X2DVD
if %pass%==13 goto SEEK
if %pass%==14 goto GIMP
if %pass%==15 goto REVO
if %pass%==16 goto SUPER
if %pass%==17 goto WEB
if %pass%==18 goto BATT
if %pass%==19 goto CONF
if %pass%==20 goto CONTROL
if %pass%==21 goto VOL
if %pass%==22 goto NSC
if %pass%==23 goto TOR
if %pass%==24 goto MUSIC
if %pass%==25 goto CLEAR
if %pass%==26 goto NETD
if %pass%==27 goto NOTES
if %pass%==28 goto CON
if %pass%==29 goto MOV
if %pass%==30 goto MBAM
if %pass%==31 goto YOUTUBE

if %pass%==drives goto DRIVES

if NOT %pass%==1 goto CYCLE
if NOT %pass%==2 goto CYCLE
if NOT %pass%==3 goto CYCLE
if NOT %pass%==4 goto CYCLE
if NOT %pass%==5 goto CYCLE
if NOT %pass%==6 goto CYCLE
if NOT %pass%==7 goto CYCLE
if NOT %pass%==8 goto CYCLE
if NOT %pass%==9 goto CYCLE
if NOT %pass%==10 goto CYCLE
if NOT %pass%==11 goto CYCLE
if NOT %pass%==12 goto CYCLE
if NOT %pass%==13 goto CYCLE
if NOT %pass%==14 goto CYCLE
if NOT %pass%==15 goto CYCLE
if NOT %pass%==16 goto CYCLE
if NOT %pass%==17 goto CYCLE
if NOT %pass%==18 goto CYCLE
if NOT %pass%==19 goto CYCLE
if NOT %pass%==20 goto CYCLE
if NOT %pass%==21 goto CYCLE
if NOT %pass%==22 goto CYCLE
if NOT %pass%==23 goto CYCLE
if NOT %pass%==24 goto CYCLE
if NOT %pass%==25 goto CYCLE
if NOT %pass%==26 goto CYCLE
if NOT %pass%==27 goto CYCLE
if NOT %pass%==28 goto CYCLE
if NOT %pass%==29 goto CYCLE
if NOT %pass%==30 goto CYCLE
if NOT %pass%==31 goto CYCLE
if NOT %pass%==drives goto CYCLE
CLS

:GOOGLE
@echo off
echo.
echo. Search Google for:
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start [url]www.google.com/search?q=%INPUT%[/url]
cls
goto CYCLE

:TRUECRYPT
@echo off
echo. 1. Mount Drive (Y:)
echo. 2. Unmount Drives
echo. 3. Quick mount (Y:)
echo. 4. Duel MOunt (Y:, Z:)
echo. 5. Quick Duel Mount (Y:, Z:)
echo. 6. Back
echo.
echo. SELECT ACTION:
set /p "pass=>"

if %pass%==1 goto MNT
if %pass%==2 goto UNMNT
if %pass%==3 goto QM
if %pass%==4 goto DMNT
if %pass%==5 goto QDMNT
if %pass%==6 goto CLS
if NOT %pass%==1 goto CYCLE
if NOT %pass%==2 goto CYCLE
if NOT %pass%==3 goto CYCLE
if NOT %pass%==4 goto CYCLE
if NOT %pass%==5 goto CYCLE
if NOT %pass%==6 goto INVALID

:DMNT
@echo off
echo. MOUNTING... DO NOT DISCONNECT
truecrypt.exe /v \Device\Harddisk2\Partition1 /ly /a /e /q /p "passwordhere" /explore
truecrypt.exe /v \Device\Harddisk3\Partition1 /lz /a /e /q /p "passwordhere" /explore
cls
goto CYCLE

:QDMNT
@@echo off
echo. MOUNTING... DO NOT DISCONNECT
truecrypt.exe /v \Device\Harddisk2\Partition1 /ly /a /q /p "passwordhere"
truecrypt.exe /v \Device\Harddisk3\Partition1 /lz /a /q /p "passwordhere"
cls
goto CYCLE

:QM
@@echo off
echo. MOUNTING... DO NOT DISCONNECT
truecrypt.exe /v \Device\Harddisk2\Partition1 /ly /a /q /p "passwordhere"
cls
goto CYCLE

:MNT
@@echo off
echo. MOUNTING... DO NOT DISCONNECT
truecrypt.exe /v \Device\Harddisk2\Partition1 /ly /a /e /q /p "passwordhere" /explore
cls
goto CYCLE

:UNMNT
@echo off
truecrypt /q /d
cls
goto CYCLE

:GAME
@echo off
echo.
echo. 1.AVGN Aventures
echo. 2.Geometry Wars
echo. 3.McPixel
echo. 4.Postal 2
echo. 5.Retro City Rampage DX
echo. 6.Shovel Knight
echo. 7.Terraria
echo. 8.Typing of the Dead Overkill
echo. 9.The Escapist
echo. 10.Postal 3
echo.
echo. SELECT GAME:
set /p "pass=>"

if %pass% ==1 goto AVGN
if %pass% ==2 goto GEO
if %pass% ==3 goto MCP
if %pass% ==4 goto POSTAL2
if %pass% ==5 goto RCR
if %pass% ==6 goto SKA
if %pass% ==7 goto TERR
if %pass% ==8 goto TOTDO
if %pass% ==9 goto ESC
if %pass% ==10 goto POSTAL3

if NOT %pass% ==1 goto INVALID
if NOT %pass% ==2 goto INVALID
if NOT %pass% ==3 goto INVALID
if NOT %pass% ==4 goto INVALID
if NOT %pass% ==5 goto INVALID
if NOT %pass% ==6 goto INVALID
if NOT %pass% ==7 goto INVALID
if NOT %pass% ==8 goto INVALID
if NOT %pass% ==9 goto INVALID
if NOT %pass% ==10 goto INVALID

:POSTAL3
@echo off
start C:\MASTER\p3.lnk
cls
goto CYCLE

:ESC
@echo off
start C:\MASTER\Escapist.lnk
cls
goto CYCLE

:POSTAL2
@echo off
start C:\MASTER\Launcher.lnk
cls
goto CYCLE

:SKA
@echo off
start C:\MASTER\ShovelKnight.lnk
cls
goto CYCLE

:AVGN
@echo off
start C:\MASTER\avgn.lnk
cls
goto CYCLE

:RCR
@echo off
start C:\MASTER\RCR.lnk
cls
goto CYCLE

:TOTDO
@echo off
start C:\MASTER\HOTD_NG.lnk
cls
goto CYCLE

:MCP
@echo off
start C:\MASTER\McPixel.lnk
cls
goto CYCLE

:GEO
@echo off
start C:\MASTER\GeometryWars.lnk
cls
goto CYCLE

:TERR
@echo off
start C:\MASTER\Terraria.lnk
cls
goto CYCLE

:FIREFOX
@echo off
echo.
echo. Search for:
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start [url]www.google.com/search?q=%INPUT%[/url]
cls
goto CYCLE

:INVALID
@echo off
echo.
echo. ****INVALID ENTRY****
cls
goto CYCLE

:DRIVES
@echo off
start explorer.exe
cls
goto CYCLE

:VAN
@echo off
start cmd.exe /k netsh wlan show all
cls
goto CYCLE

:CMD
@echo off
start cmd.exe
cls
goto CYCLE

:VIRT
@echo off
start C:\MASTER\VirtualRouterClient.lnk
cls
goto CYCLE

:MPC
@echo off
start C:\MASTER\MPC.lnk
cls
goto CYCLE

:IMGB
@echo off
start C:\MASTER\ImgBurn.lnk
cls
goto CYCLE

:???
@echo off
start C:\MASTER\???.lnk
cls
goto CYCLE

:CCLEANER
@echo off
start C:\MASTER\CCleaner.lnk
cls
goto CYCLE

:DIS
@echo off
echo.
echo. 1.Disable Network Adapter
echo. 2.Enable Network Adapter
echo. 3.Exit
echo.
echo. SELECT OPTION:
set /p "net=>"

if %net%==1 goto ND
if %net%==2 goto NE
if %net%==3 goto CS

if NOT %net%==1 goto CS
if NOT %net%==2 goto CS
if NOT %net%==3 goto CS

:CS
cls
goto CYCLE

:ND
start ND.exe
net stop Wlansvc
cls
goto CYCLE

:NE
start NE.exe
net start Wlansvc
cls
goto CYCLE

:X2DVD
@echo off
start C:\MASTER\convert.lnk
cls
goto CYCLE

:SEEK
@echo off
start C:\MASTER\MasterSeeker.lnk
cls
goto CYCLE

:GIMP
@echo off
start C:\MASTER\gimp.lnk
cls
goto CYCLE

:REVO
@echo off
start C:\MASTER\Revo.lnk
cls
goto CYCLE

:SUPER
@echo off
start C:\MASTER\SUPER.lnk
cls
goto CYCLE

:CONTROL
@echo off
start control
cls
goto CYCLE

:VOL
@echo off
start sndvol.exe
cls
goto CYCLE

:NSC
@echo off
explorer.exe shell:::{1fa9085f-25a2-489b-85d4-86326eedcd87}
cls
goto CYCLE

:BATT
@echo off
echo.
:: Use WMI to retrieve battery status information
FOR /F "tokens=1* delims==" %%A IN ('WMIC /NameSpace:"\\root\WMI" Path BatteryStatus              Get Charging^,Critical^,Discharging /Format:list ^| FIND "=TRUE"') DO ECHO Battery is %%A
FOR /F "tokens=*  delims="  %%A IN ('WMIC /NameSpace:"\\root\WMI" Path BatteryStatus              Get PowerOnline^,RemainingCapacity  /Format:list ^| FIND "="')     DO SET  Battery.%%A
FOR /F "tokens=*  delims="  %%A IN ('WMIC /NameSpace:"\\root\WMI" Path BatteryRuntime             Get EstimatedRuntime                /Format:list ^| FIND "="')     DO SET  Battery.%%A
FOR /F "tokens=*  delims="  %%A IN ('WMIC /NameSpace:"\\root\WMI" Path BatteryFullChargedCapacity Get FullChargedCapacity             /Format:list ^| FIND "="')     DO SET  Battery.%%A

:: Calculate runtime left and capacity
SET /A Battery.EstimatedRuntime  = ( %Battery.EstimatedRuntime% + 30 ) / 60
SET /A Battery.RemainingCapacity = ( %Battery.RemainingCapacity%00 + %Battery.FullChargedCapacity% / 2 ) / %Battery.FullChargedCapacity%

:: Display results
echo.
echo.

IF /I "%Battery.PowerOnline%"=="TRUE" (

	ECHO 	Now working on main power
	ECHO. 
	ECHO 	Battery %Battery.RemainingCapacity%%% charged
	ECHO. 
	ECHO. 
) ELSE (
	ECHO. 
	ECHO 	Estimated remaining runtime %Battery.EstimatedRuntime% minutes
	ECHO. 
	ECHO 	Remaining capacity %Battery.RemainingCapacity%%%
	ECHO. 
	ECHO. 
)

powercfg /list
echo.
echo. SELECT POWER PLAN:
echo.
echo. 1. High Performance
echo. 2. Power saver
echo. 3. Exit

set /p "pass=>"

if '%pass%'=='1' goto HP
if '%pass%'=='2' goto PS
if '%pass%'=='3' goto CLS

if NOT %pass%==1 goto CYCLE
if NOT %pass%==2 goto CYCLE
if NOT %pass%==2 goto CYCLE

pause
cls
goto CYCLE

:CONF
start ACCESS.txt
cls
goto CYCLE

:WEB
@echo off
echo.
echo. Choose website Destination...
echo.
echo. 1.???
echo. 2.Facebook
echo. 3.Overclockers UK
echo. 4.Huntington Bank Online

set /p "pass=>"

if %pass% ==1 goto ???
if %pass% ==2 goto FACE
if %pass% ==3 goto OVER
if %pass% ==4 goto HUNT

if NOT %pass% ==1 goto INVALID
if NOT %pass% ==2 goto INVALID
if NOT %pass% ==3 goto INVALID
if NOT %pass% ==4 goto INVALID

:HUNT
@echo off
start firefox.exe [url]https://onlinebanking.huntington.com/rol/Auth/login.aspx[/url]
cls
goto CYCLE

:YOUTUBE
@echo off
echo.
echo. Choose topic to search:
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start [url]www.youtube.com/results?search_query=%INPUT%[/url]
cls
goto CYCLE

:???
@ehco off
start firefox.exe ???
cls
goto CYCLE

:FACE
@echo off
start [url]https://www.facebook.com/[/url]
cls
goto CYCLE

:OVER
@echo off
start [url]http://forums.overclockers.co.uk/[/url]
cls
goto CYCLE

:TOR
@echo off
start C:\tor.lnk
cls
goto CYCLE

:MUSIC
start Y:\Playlists\Music_Playlist.mpcpl
cls
goto CYCLE

:CLEAR
@echo off

taskkill /f /im firefox.exe
taskkill /f /im ThrottleStop.exe
taskkill /f /im notepad.exe
taskkill /f /im taskmgr.exe
taskkill /f /im CCleaner64.exe
taskkill /f /im mpc-hc64.exe
taskkill /f /im MasterSeeker.exe
taskkill /f /im gimp-2.8.exe
taskkill /f /im Launcher.exe
taskkill /f /im tor.exe
taskkill /f /im explorer.exe
taskkill /f /im SndVol.exe
taskkill /f /im Azureus.exe
taskkill /f /im cmd.exe
taskkill /f /im AutoHideMouseCursor_x64.exe
cls
goto CYCLE

:NETD
@echo off
cls
:start
ECHO Please select a command from the list below
echo.
echo.
ECHO 1) Enable Network Discovery
ECHO 2) Disable Network Discovery

set choice=
set /p choice=Please enter the command number :
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,9%
if '%choice%'=='1' goto enable
if '%choice%'=='2' goto disable

:enable
netsh advfirewall firewall set rule group="network discovery" new enable=yes
cls
Echo Network Discovery Enabled
ping localhost -n 2 >nul
goto CYCLE

:disable
netsh advfirewall firewall set rule group="network discovery" new enable=no
cls
Echo Network Discovery Disabled
ping localhost -n 2 >nul
goto CYCLE

:HP
@echo off
powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
echo. set to HIGH PERFORMANCE
pause

cls
goto CYCLE

:PS
@echo off
powercfg /setactive a1841308-3541-4fab-bc81-f71556f20b4a
echo. set to POWER SAVER
pause
cls
goto CYCLE

:CLS
cls
goto CYCLE

:NOTES
@echo off
start NOTES.txt
cls
goto CYCLE

:CON
@echo off
ECHO Checking connection, please wait...
PING -n 1 [url]www.google.com|find[/url] "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESS
IF     ERRORLEVEL 1 goto :TRYAGAIN

:TRYAGAIN
ECHO FAILURE!
ECHO Let me try a bit more, please wait...
@echo off
PING -n 3 [url]www.google.com|find[/url] "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESS2
IF     ERRORLEVEL 1 goto :TRYIP

:TRYIP
ECHO FAILURE!
ECHO Checking DNS...
ECHO Lets try by IP address...
@echo off
ping -n 1 216.239.37.99|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :SUCCESSDNS
IF     ERRORLEVEL 1 goto :TRYROUTER

:TRYROUTER
ECHO FAILURE!
ECHO Lets try pinging the router....
ping -n 2 192.168.1.1|find "Reply from " >NUL
IF NOT ERRORLEVEL 1 goto :ROUTERSUCCESS
IF     ERRORLEVEL 1 goto :NETDOWN

:ROUTERSUCCESS
ECHO It appears that you can reach the router, but internet is unreachable.
goto :FAILURE

:NETDOWN
ECHO FAILURE!
ECHO It appears that you having network issues, the router cannot be reached.
goto :FAILURE

:SUCCESSDNS
ECHO It appears that you are having DNS issues.
goto :FAILURE

:SUCCESS
ECHO.
ECHO ****CONNECTED****
ECHO.
pause
cls
goto CYCLE

:SUCCESS2
ECHO You have an active internet connection but some packet loss was detected.
pause
cls
goto CYCLE

:FAILURE
ECHO.
ECHO ****NOT CONNECTED****
ECHO.
pause
cls
goto CYCLE

:MOV
@echo off
echo.
echo.
Echo. 1.Movies
echo. 2.Anime
echo. 3.Documentaries
echo.
echo. "NOTE: TRUECRYPT DRIVE MUST BE CONNECTED"
set /p "pass=>"

if %pass%==1 goto MLIST
if %pass%==2 goto ALIST
if %pass%==3 goto DLIST

if NOT %pass%==1 goto CYCLE
if NOT %pass%==2 goto CYCLE
if NOT %pass%==3 goto CYCLE

:MLIST
@echo off
echo.
echo. 1. 3 Ninjas - High Noon at Mega Mountain 
echo. 2. 3 Ninjas - Kick Back
echo. 3. 3 Ninjas Knuckle Up
echo. 4. 3 Ninjas
echo. 5. 21
echo. 6. 28 Days LAter

set /p "pass=>"

if %pass%==1 goto 3NHNMM
if %pass%==2 goto 3NKB
if %pass%==3 goto 3NKU

if NOT %pass%==1 goto MLIST
if NOT %pass%==2 goto MLIST
if NOT %pass%==3 goto MLIST

:3NHNMM
@echo off
start Y:\Movies\3_Ninjas_High_Noon_at_Mega_Mountain.avi
exit

:3NKB
@echo off

:3NKU
@echo off

:MBAM
@echo off
start C:\MASTER\mbam.lnk
cls
goto CYCLE
 
Last edited:
Thank you so much for that KIA that looks a lot better. Still learning how to use this forum lol. I corrected my post. :). I replaced my explorer.exe with this .bat file through my registry... my goal was to make my windows OS more LUI instead of GUI but this is still in development. I need to find ways to make it so when you navigate you don't need explorer.exe. If you read the code you got a "drives" option... this opens explorer.exe to view My Computer. You may notice on your Task Manager there may be a few explorer.exe under processes but again this is a work in process... I also got a update.vbs file that updates my windows 7 through command... it is a workaround for my current windows update because I can't use it normally... I just haven't had a lot of time to mess with that and this is a quick fix. I found this online as a quick way to install updates on servers but it works on my computer :). Hope this is useful for anyone.

NOTE: I have this in system32 folder. open command prompt and type "cscript update.vbs" without quotations. I also have Driver Booster to update my drivers.

Code:
'Before you attempt to run this sample, note the following:
'•WUA must be installed on the computer. For more information about how to determine the version of WUA that is installed, see Determining the Current Version of WUA..
'•WUA prompts the user to restart the computer if an update requires a restart.
'•The sample can download updates only by using WUA. It cannot download updates from a Software Update Services (SUS) 1.0 server.
 
'Running this sample requires Windows Script Host (WSH). For more information about WSH, see the WSH section of the Platform Software Development Kit (SDK). 
'If the sample is copied to a file named WUA_SearchDownloadInstall.vbs, you can run the sample by opening a Command Prompt window and typing the following command at the command prompt.
 'cscript WUA_SearchDownloadInstall.vbs
 ' or you can create a simple batch file like below and then run that batch file
 'cscript WUA_SearchDownloadInstall.vbs
'pause




Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()

WScript.Echo "Searching for updates..." & vbCRLF

Set searchResult = _
updateSearcher.Search("IsInstalled=0 and Type='Software'")


WScript.Echo "List of applicable items on the machine:"

For I = 0 To searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    WScript.Echo I + 1 & "> " & update.Title
Next

If searchResult.Updates.Count = 0 Then
	WScript.Echo "There are no applicable updates."
	WScript.Quit
End If

WScript.Echo vbCRLF & "Creating collection of updates to download:"

Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")

For I = 0 to searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    WScript.Echo I + 1 & "> adding: " & update.Title 
    updatesToDownload.Add(update)
Next

WScript.Echo vbCRLF & "Downloading updates..."

Set downloader = updateSession.CreateUpdateDownloader() 
downloader.Updates = updatesToDownload
downloader.Download()

WScript.Echo  vbCRLF & "List of downloaded updates:"

For I = 0 To searchResult.Updates.Count-1
    Set update = searchResult.Updates.Item(I)
    If update.IsDownloaded Then
       WScript.Echo I + 1 & "> " & update.Title 
    End If
Next

Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")

WScript.Echo  vbCRLF & _
"Creating collection of downloaded updates to install:" 

For I = 0 To searchResult.Updates.Count-1
    set update = searchResult.Updates.Item(I)
    If update.IsDownloaded = true Then
       WScript.Echo I + 1 & "> adding:  " & update.Title 
       updatesToInstall.Add(update)	
    End If
Next

WScript.Echo  vbCRLF & "Would you like to install updates now? (Y/N)"
strInput = WScript.StdIn.Readline
WScript.Echo 

If (strInput = "N" or strInput = "n") Then 
	WScript.Quit
ElseIf (strInput = "Y" or strInput = "y") Then
	WScript.Echo "Installing updates..."
	Set installer = updateSession.CreateUpdateInstaller()
	installer.Updates = updatesToInstall
	Set installationResult = installer.Install()
	
	'Output results of install
	WScript.Echo "Installation Result: " & _
	installationResult.ResultCode 
	WScript.Echo "Reboot Required: " & _ 
	installationResult.RebootRequired & vbCRLF 
	WScript.Echo "Listing of updates installed " & _
	 "and individual installation results:" 
	
	For I = 0 to updatesToInstall.Count - 1
		WScript.Echo I + 1 & "> " & _
		updatesToInstall.Item(i).Title & _
		": " & installationResult.GetUpdateResult(i).ResultCode 		
	Next
End If
 
Last edited:
It works Rroff but I assume you know that where I have my program and game options they are mostly directed to my MASTER folder I have on my C drive. The MASTER folder has my shortcuts I made to my stuff... I had issues where if I had to write "goto here/ here/ here/ here /etc." it wouldn't let me so I use the shortcuts to get around it. I also gotta point out I converted a couple of my batches to exe.... my disable network adapter option. I had a error message using devcon.exe (which I downloaded) but it still worked so I converted it through bat2exe and made it run invisibly so I didn't have to see it. it's the ND.exe and NE.exe:

Code:
:DIS
@echo off
echo.
echo. 1.Disable Network Adapter
echo. 2.Enable Network Adapter
echo. 3.Exit
echo.
echo. SELECT OPTION:
set /p "net=>"

if %net%==1 goto ND
if %net%==2 goto NE
if %net%==3 goto CS

if NOT %net%==1 goto CS
if NOT %net%==2 goto CS
if NOT %net%==3 goto CS

:CS
cls
goto CYCLE

:ND
start [B][COLOR="Red"]ND.exe[/COLOR][/B]
net stop Wlansvc
cls
goto CYCLE

:NE
start [B][COLOR="Red"]NE.exe[/COLOR][/B]
net start Wlansvc
cls
goto CYCLE

I'm really happy with the internet search and youtube search :).

search through google with BAT:

Code:
@echo off
echo.
echo. Search for:
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start www.google.com/search?q=%INPUT%
cls

Youtube search on BAT:

Code:
@echo off
echo.
echo. Choose topic to search:
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start www.youtube.com/results?search_query=%INPUT%
cls

I use firefox so it's my default browser. My next thing I want to do is:

1. Log into overclockers uk with the same idea as my google search but I wouldn't know what commands I could use to tell my batch to go to overclockers uk and log in with my user and password.

2. Make a multi tab search option for searching on google... I'm working on it though. Found out last night of using -new -tab to open multiple tabs on firefox through command... I'm hoping to at least open 3 tabs in total... I want it this way so I can multitask searching different things.
 
Last edited:
rather than having all the lines saying

if NOT %pass%==1 goto CYCLE
if NOT %pass%==2 goto CYCLE
ect

Stick something like the following under all the valid choices
if "%pass%"=="" goto CYCLE
GOTO CYCLE


On another note as much as i love bat files you may find learning hta/vbs or powershell far more productive/powerfull :)
 
I was thinking of learning powershell. I know a lot of people talk about it and how powerful it is. I also know it reads batch too from what I read. I just don't know what I could do with powershell.
 
Last edited:
LizardKing could you explain to me the difference between if %pass%== goto CYCLE and if "%pass%"==""goto CYCLE?
 
Last edited:
Was about the WMIC stuff rather than the bat file as a whole.

My apologies Rroff. I understand what you mean now. I hope to make this .bat more useful over time... I'd really like to finish studying python. Right now I'm trying to write a program to play rock paper scissors lol.
 
Last edited:
UPDATE:

I found out how to launch firefox with an extra tab but I need to figure out how to make seperate results... tested with the word hello and two tabs with the results for hello comes up.
Code:
:FIREFOX
@echo off
echo.
echo. Search for:
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start "www.google.com/search?q=%INPUT%" firefox.exe -new-tab -url www.google.com/search?q=%INPUT%
cls
goto CYCLE

I'll figure out more later but thought this was interesting to share :-)
 
Last edited:
I finally got it :)

Code:
:FIREFOX
@echo off
echo.
echo. Multi-Search? (y/n)
set /p "ANS=>"


if %ANS%==y goto Y
if %ANS%==n goto N

if NOT %ANS%==y goto CYCLE
if NOT %ANS%==n goto CYCLE

:Y
@echo off
set /p "INPUT=>"
set /p "INPUT2=>"
set /p "INPUT3=>"

set INPUT=%INPUT: =+%
set INPUT=%INPUT2: =+%
set INPUT=%INPUT3: =+%

start firefox.exe "www.google.com/search?q=%INPUT%" "www.google.com/search?q=%INPUT2%" "www.google.com/search?q=%INPUT3%"
cls
goto CYCLE

:N
@echo off
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start firefox.exe "www.google.com/search?q=%INPUT%"
cls
goto CYCLE

Sorry everyone the last post I made was not working right but this post is correct. I plan to experiment with LizardKing's reply hopefully later today. Thank you to everyone givng suggestions and if anyone uses this please give me some feedback. Next I'm gonna try logging into Overclockers UK with a bat file.

**Found an issue with the search results... two of the same thing I type for one input comes up on two tabs... back to the drawing board :(**
 
Last edited:
Fixed it:

Code:
:FIREFOX
@echo off
echo.
echo. Multi-Search? (y/n)
set /p "ANS=>"


if %ANS%==y goto Y
if %ANS%==n goto N

if NOT %ANS%==y goto CYCLE
if NOT %ANS%==n goto CYCLE

:Y
@echo off
echo.Search for:
set /p "INPUT1=>"
set /p "INPUT2=>"
set /p "INPUT3=>"

set INPUT=%INPUT1: =+%
set INPUT=%INPUT2: =+%
set INPUT=%INPUT3: =+%

start firefox.exe "www.google.com/search?q=[COLOR="Red"]"%INPUT1%"[/COLOR]" "www.google.com/search?q=[COLOR="Red"]"%INPUT2%"[/COLOR]" "www.google.com/search?q=[COLOR="Red"]"%INPUT3%"[/COLOR]"
cls
goto CYCLE

:N
@echo off
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start firefox.exe "www.google.com/search?q=%INPUT%"
cls
goto CYCLE

*** Never mind another complication :(***
 
Last edited:
Ok this time I finally got it... I tested it with sentences and single words and it finally works... debating if I should have an option that allows to switch it so I can use two separate windows for like a side by side search but hey this is pretty cool I had no idea I could do this lol.

Code:
:FIREFOX
@echo off
echo.
echo. Multi-Search? (y/n)
set /p "ANS=>"


if %ANS%==y goto Y
if %ANS%==n goto N

if NOT %ANS%==y goto CYCLE
if NOT %ANS%==n goto CYCLE

:Y
@echo off
echo.
echo.Search for:
set /p "INPUT1=>"
set /p "INPUT2=>"
set /p "INPUT3=>"

[B][COLOR="Red"]set INPUT1=%INPUT1: =+%
set INPUT2=%INPUT2: =+%
set INPUT3=%INPUT3: =+%[/COLOR][/B]

start firefox.exe "www.google.com/search?q=%INPUT1%" "www.google.com/search?q=%INPUT2%" "www.google.com/search?q=%INPUT3%"
cls
goto CYCLE

:N
@echo off
echo.
echo.Search for:
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start firefox.exe "www.google.com/search?q=%INPUT%"
cls
goto CYCLE

I wanna make a note on this that when altering my bat file I had some issues... how I have this setup is I got my files I alter:
ACCESS.bat
ACCESS2.bat
ACCESS.ahk

They are in my system32 and my SysWOW64 folder.... this added a lot of unnecessary complications testing... so here in the future I want to make a command where if I save one config option in my ACCESS.bat or ACCESS2.bat it'll save in system32 but also save in the SysWOW64 folder. the ACCESS.bat and ACCESS2.bat I have keeps it so when you use Auto-Hide Mouse Cursor it wo'nt pop up the program for it when you close the command window.... ACCESS.ahk I have it so you can use the win key + A to bring it back up... so on startup it runs ACCESS.bat and when you close it you use the shortcut key for ACCESS2.bat. if you run ACCESS.bat with the Auto-Hide Mouse Cursor program when you close out of the ACCESS.bat on startup you get the program window popped up... I'm debating if I want my cursor to disappear so I may remove it to avoid over complicating this.

So now all i gotta do is work on the login to this site and I should be ok. There is one more thing I'd like to do... so far with my external drives I made a bat command based where ever it is on my external it scan the current directory and lists all of the files.... I'd like to get it to set it up on the list to a similar setup to where I choose numbers to select my files... the purpose of this is to eliminate the use of explorer.exe as much as I can. I really like the snappiness of command prompt. I also ran ACCESS.bat in Powershell and it still works... so I'm going to look into Windows Powershell. Gotta get hip with the times lol. I'm thinking now the duel window feature is kind of pointless now... just pressing Ctrl+tab you can just cycle through the tabs. If I come up with more things I'll post more on here. Again if anyone uses this code or thinks the can improve it please let me know.
 
Last edited:
I assume with this, you'll see a CMD window?

If so, you can use

Code:
title example

This will rename the cmd window with 'example', handy extra :)
 
Yeah it shows in the CMD window. Thank you bledd., I actually tried that. I like how I can see ACCESS2.bat in my window I call back up with my win+a shortcut with AutoHotkey.
 
Last edited:
Well I came up with this so far... I had to make it a VBS file but I saved that into my system32 folder and called it OVER.vbs:

Code:
MyUserinput1 = inputbox("USER", USER)
MyUserinput2 = inputbox("PASSWORD", PASSWORD)

set WshShell = WScript.CreateObject("WScript.Shell")
set a = createobject("wscript.shell")
call WshShell.Run("http://forums.overclockers.co.uk") 'This will open your default browser
[B][COLOR="Red"]wscript.sleep (5000)[/COLOR][/B]
a.sendkeys ("{TAB}")
a.sendkeys MyUserinput1
a.sendkeys ("{TAB}")
a.sendkeys MyUserinput2
a.sendkeys ("{ENTER}")
wscript.quit

It prompts user and after you put in your username press enter and it'll do the same with the password. I've highlight some code in red because you may have to change the number in the wscript.sleep command... I've set mine to 5000 but try messing with it if it doesn't load right... I don't see it needing to be any higher than 10000. I really want to mask the words... to prevent should surfing but I'm VERY new to VBS.

I also just tried using my web address that I have when I go straight to my threads I posted and it works to.

Code:
MyUserinput1 = inputbox("USER", USER)
MyUserinput2 = inputbox("PASSWORD", PASSWORD)

set WshShell = WScript.CreateObject("WScript.Shell")
set a = createobject("wscript.shell")
call WshShell.Run([B][COLOR="Red"]"https://forums.overclockers.co.uk/search.php?searchid=23308730"[/COLOR][/B]) 'This will open your default browser
wscript.sleep (5000)
a.sendkeys ("{TAB}")
a.sendkeys MyUserinput1
a.sendkeys ("{TAB}")
a.sendkeys MyUserinput2
a.sendkeys ("{ENTER}")
wscript.quit

Also, as a side note I also assigned the Snipping Tool for windows 7 as win+s on my my ACCESS.ahk. I find it really useful to keep track of order numbers online when I purchased a small cooling device for my laptop that I'll being doing tests with very soon :).
 
Last edited:
Current update on this post. I applied LizardKing's suggestion and it helped reduce the if NOT parts of my batch. After tinkering with my bat more I found out the set /p command was causing me issues storing variables so if I say pressed 1 for truecypt and show all the options if I pressed nothing and pressed enter it would still have one stored and it would automatically use the 1 variable to open the next option. I'll post my new revisions later today. Also thanks to LizardKing I understand a little about how less code is better. I did some research on the topic and I'm still trying to grasp the concept but it makes sense.
 
Last edited:
When I write bat files, I'll update the title each time it reaches a section that it will pause on
 
That sounds like a pretty good idea bledd. I tried adding the title command to my truecrypt stuff to see how I would like it but based on my current config if I use the tile command it would change the title to truecrpt which I wanted it to do that but it would stay that title once it went to CYCLE... is there anything you could suggest to me to get it to read ACCESS.bat again? Here's what I did. I highlighted your suggestion in red.

Code:
@echo off
[B][COLOR="Red"]title ACCESS2.bat[/COLOR][/B] *YOUR SUGGESTION
start ACCESS.ahk

:CYCLE
set "pass=00"
cls
color 03

For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)

echo.
echo.------------------------------------------------------
echo. MAIN MENU                        %mydate% %mytime%
echo.------------------------------------------------------
@echo off
echo.
echo. 1.Truecrypt                      19.CONFIG SETTINGS                  
echo. 2.Games                          20.Control Panel
echo. 3.Internet Search                21.Volume Control
echo. 4.View Available Networks        22.Manage Wireless Networks
echo. 5.Command Prompt                 23.Tor
echo. 6.Virtual Router                 24.Music Playlist
echo. 7.Media Player Classic           25.Clear Running Programs
echo. 8.Imgburn                        26.Network Discovery
echo. 9.Vuze                           27.Notes
echo. 10.CCleaner                      28.Test Connectivity
echo. 11.Disconnect From Network       29.Movie /Anime List
echo. 12.ConvertXtoDVD                 30.MBAM
echo. 13.MasterSeeker                  31.Youtube Search
echo. 14.GIMP 2.8                      32.Shutdown /Restart Computer
echo. 15.Revo Uninstaller                    
echo. 16.SUPER Converter              
echo. 17.Websites            
echo. 18.Battery /Power Options                           
echo.
echo.------------------------------------------------------
echo. DRIVES CAN BE SEEN BY TYPING "drives"
echo.------------------------------------------------------
echo.
echo. SELECT DESTINATION:
set /p "pass=>"


if %pass%==1 goto TRUECRYPT
if %pass%==2 goto GAME
if %pass%==3 goto FIREFOX
if %pass%==4 goto VAN
if %pass%==5 goto CMD
if %pass%==6 goto VIRT
if %pass%==7 goto MPC
if %pass%==8 goto IMGB
if %pass%==9 goto VUZE
if %pass%==10 goto CCLEANER
if %pass%==11 goto DIS
if %pass%==12 goto X2DVD
if %pass%==13 goto SEEK
if %pass%==14 goto GIMP
if %pass%==15 goto REVO
if %pass%==16 goto SUPER
if %pass%==17 goto WEB
if %pass%==18 goto BATT
if %pass%==19 goto CONF
if %pass%==20 goto CONTROL
if %pass%==21 goto VOL
if %pass%==22 goto NSC
if %pass%==23 goto TOR
if %pass%==24 goto MUSIC
if %pass%==25 goto CLEAR
if %pass%==26 goto NETD
if %pass%==27 goto NOTES
if %pass%==28 goto CON
if %pass%==29 goto MOV
if %pass%==30 goto MBAM
if %pass%==31 goto YOUTUBE
if %pass%==32 goto SHUTDOWN

if %pass%==drives goto DRIVES

if "%pass%"=="" goto CYCLE
GOTO CYCLE
CLS

:SHUTDOWN
@echo off
set "CHS=00"
echo.
echo. 1.shutdown
echo. 2.restart
echo.
echo. SELECT:
set /p "CHS=>"

if %CHS%==1 goto SHUT
if %CHS%==2 goto RESTART

if %CHS%==00 goto CYCLE
if "%CHS%"=="" goto CYCLE

GOTO CYCLE

:SHUT
@echo off
shutdown /s /t 000
exit

:RESTART
@echo off
shutdown /r /t 000
exit

:GOOGLE
@echo off
echo.
echo. Search Google for:
set /p "INPUT=>"
set INPUT=%INPUT: =+%
start www.google.com/search?q=%INPUT%
cls
goto CYCLE

:TRUECRYPT
@echo off
set "pass=00"

[B][COLOR="Red"]title Truecrypt[/COLOR][/B] *YOUR SUGGESTION

echo. 1. Mount Drive (Y:)
echo. 2. Unmount Drives
echo. 3. Quick mount (Y:)
echo. 4. Duel MOunt (Y:, Z:)
echo. 5. Quick Duel Mount (Y:, Z:)
echo. 6. Back
echo.
echo. SELECT ACTION:
set /p "pass=>"

if %pass%==1 goto MNT
if %pass%==2 goto UNMNT
if %pass%==3 goto QM
if %pass%==4 goto DMNT
if %pass%==5 goto QDMNT
if %pass%==6 goto CLS

if "%pass%"=="" goto CYCLE
cls
GOTO CYCLE
 
Last edited:
Back
Top Bottom