none
Converting Batch to VBScript or HTA Application RRS feed

  • Question

  • If anyone would convert them then I will add their name in the application. I know its a lot, so thanks for any reply:

    @echo off

    :home

    title Rhett's Tools
    color 07
    cls
    echo ======================
    echo Rhett's Computer Tools
    echo ======================
    echo (You can enter specific menus to get 
    echo  to your destination faster. Go and "codes" or push the number 4
    echo  to see the code names.
    echo.
    echo [1] Internet Explorer
    echo [2] Google Chrome
    echo [3] Mozilla Firefox
    echo [4] Website Unblocker
    echo [5] Codes
    echo [6] Computer Cleaner
    echo [7] Really Dangerous Tools
    echo [8] Internet Speed Increaser
    echo [9] Ping Speed
    echo [10] Exit
    echo ---------------------------------
    echo
    set /p op=
    if %op%==1 goto ie
    if %op%==2 goto gc
    if %op%==3 goto ff
    if %op%==4 goto un
    if %op%==5 goto codes
    if %op%==6 goto cleaner
    if %op%==7 goto dangtools
    if %op%==8 goto speedup
    if %op%==9 goto pinger
    if %op%==10 goto exit
    if %op%==codes goto codes
    if %op%==un goto un
    if %op%==gc goto gc
    if %op%==ie goto ie
    if %op%==crasher goto crasher
    if %op%==Cmd goto passcmd
    if %op%==cleaner goto cleaner
    goto error

    :pinger
    echo ==============
    echo Pinger Speed
    echo ==============---------------------
    echo To find the ping speed push any key
    echo -----------------------------------
    pause
    ping localhost
    pause
    goto home

    :dangtools
    echo ------------------------------------------
    echo [1] For website Crasher press 1
    echo ------------------------------------------
    echo [2] Password opened Command Prompt
    echo ------------------------------------------
    echo [3] Exit
    echo ---------
    echo
    set /p op=
    if %op%==3 goto exit
    if %op%==1 goto crasher
    if %op%==2 goto passcmd
    if %op%==cmd goto cmd


    :cleaner
    @echo off
    title PC Cleanup Utility by Rhett

    :menu
    cls
    echo --------------------------------------------------------------------------------
    echo PC Cleanup Utility
    echo --------------------------------------------------------------------------------
    echo.
    echo Select a tool
    echo =============
    echo.
    echo [1] Delete Internet Cookies
    echo [2] Delete Temporary Internet Files
    echo [3] Disk Cleanup
    echo [4] Disk Defragment
    echo [5] Exit
    echo.
    set /p op=Run:
    if %op%==1 goto 1
    if %op%==2 goto 2
    if %op%==3 goto 3
    if %op%==4 goto 4
    if %op%==5 goto exit
    goto error

    :1
    cls
    echo --------------------------------------------------------------------------------
    echo Delete Internet Cookies
    echo --------------------------------------------------------------------------------
    echo.
    echo Deleting Cookies...
    ping localhost -n 3 >nul
    del /f /q "%userprofile%\Cookies\*.*"
    cls
    echo --------------------------------------------------------------------------------
    echo Delete Internet Cookies
    echo --------------------------------------------------------------------------------
    echo.
    echo Cookies deleted.
    echo.
    echo Press any key to return to the menu. . .
    pause >nul
    goto menu
    :2
    cls
    echo --------------------------------------------------------------------------------
    echo Delete Temporary Internet Files
    echo --------------------------------------------------------------------------------
    echo.
    echo Deleting Temporary Files...
    ping localhost -n 3 >nul
    del /f /q "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
    cls
    echo --------------------------------------------------------------------------------
    echo Delete Temporary Internet Files
    echo --------------------------------------------------------------------------------
    echo.
    echo Temporary Internet Files deleted.
    echo.
    echo Press any key to return to the menu. . .
    pause >nul
    goto menu
    :3
    cls
    echo --------------------------------------------------------------------------------
    echo Disk Cleanup
    echo --------------------------------------------------------------------------------
    echo.
    echo Running Disk Cleanup...
    ping localhost -n 3 >nul
    if exist "C:\WINDOWS\temp"del /f /q "C:WINDOWS\temp\*.*"
    if exist "C:\WINDOWS\tmp" del /f /q "C:\WINDOWS\tmp\*.*"
    if exist "C:\tmp" del /f /q "C:\tmp\*.*"
    if exist "C:\temp" del /f /q "C:\temp\*.*"
    if exist "%temp%" del /f /q "%temp%\*.*"
    if exist "%tmp%" del /f /q "%tmp%\*.*"
    if not exist "C:\WINDOWS\Users\*.*" goto skip
    if exist "C:\WINDOWS\Users\*.zip" del "C:\WINDOWS\Users\*.zip" /f /q
    if exist "C:\WINDOWS\Users\*.exe" del "C:\WINDOWS\Users\*.exe" /f /q
    if exist "C:\WINDOWS\Users\*.gif" del "C:\WINDOWS\Users\*.gif" /f /q
    if exist "C:\WINDOWS\Users\*.jpg" del "C:\WINDOWS\Users\*.jpg" /f /q
    if exist "C:\WINDOWS\Users\*.png" del "C:\WINDOWS\Users\*.png" /f /q
    if exist "C:\WINDOWS\Users\*.bmp" del "C:\WINDOWS\Users\*.bmp" /f /q
    if exist "C:\WINDOWS\Users\*.avi" del "C:\WINDOWS\Users\*.avi" /f /q
    if exist "C:\WINDOWS\Users\*.mpg" del "C:\WINDOWS\Users\*.mpg" /f /q
    if exist "C:\WINDOWS\Users\*.mpeg" del "C:\WINDOWS\Users\*.mpeg" /f /q
    if exist "C:\WINDOWS\Users\*.ra" del "C:\WINDOWS\Users\*.ra" /f /q
    if exist "C:\WINDOWS\Users\*.ram" del "C:\WINDOWS\Users\*.ram"/f /q
    if exist "C:\WINDOWS\Users\*.mp3" del "C:\WINDOWS\Users\*.mp3" /f /q
    if exist "C:\WINDOWS\Users\*.mov" del "C:\WINDOWS\Users\*.mov" /f /q
    if exist "C:\WINDOWS\Users\*.qt" del "C:\WINDOWS\Users\*.qt" /f /q
    if exist "C:\WINDOWS\Users\*.asf" del "C:\WINDOWS\Users\*.asf" /f /q
    :skip
    if not exist C:\WINDOWS\Users\Users\*.* goto skippy /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.zip del C:\WINDOWS\Users\Users\*.zip /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.exe del C:\WINDOWS\Users\Users\*.exe /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.gif del C:\WINDOWS\Users\Users\*.gif /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.jpg del C:\WINDOWS\Users\Users\*.jpg /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.png del C:\WINDOWS\Users\Users\*.png /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.bmp del C:\WINDOWS\Users\Users\*.bmp /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.avi del C:\WINDOWS\Users\Users\*.avi /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.mpg del C:\WINDOWS\Users\Users\*.mpg /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.mpeg del C:\WINDOWS\Users\Users\*.mpeg /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.ra del C:\WINDOWS\Users\Users\*.ra /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.ram del C:\WINDOWS\Users\Users\*.ram /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.mp3 del C:\WINDOWS\Users\Users\*.mp3 /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.asf del C:\WINDOWS\Users\Users\*.asf /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.qt del C:\WINDOWS\Users\Users\*.qt /f /q
    if exist C:\WINDOWS\Users\AppData\Temp\*.mov del C:\WINDOWS\Users\Users\*.mov /f /q
    :skippy
    if exist "C:\WINDOWS\ff*.tmp" del C:\WINDOWS\ff*.tmp /f /q
    if exist C:\WINDOWS\ShellIconCache del /f /q "C:\WINDOWS\ShellI~1\*.*"
    cls
    echo --------------------------------------------------------------------------------
    echo Disk Cleanup
    echo --------------------------------------------------------------------------------
    echo.
    echo Disk Cleanup successful!
    echo.
    pause
    goto menu
    :4
    cls
    echo --------------------------------------------------------------------------------
    echo Disk Defragment
    echo --------------------------------------------------------------------------------
    echo.
    echo Defragmenting hard disks...
    ping localhost -n 3 >nul
    defrag -c -v
    cls
    echo --------------------------------------------------------------------------------
    echo Disk Defragment
    echo --------------------------------------------------------------------------------
    echo.
    echo Disk Defrag successful!
    echo.
    pause
    goto menu
    :error
    cls
    echo Command not recognized.
    ping localhost -n 4 >nul
    goto menu


    echo Thanks for using PC Cleanup Utility by Rhett
    ping 127.0.0.1 >nul
    exit

    :passcmd
    @echo off
    :home2
    title Log in to CMD
    color 07
    cls
    echo.
    echo Cmd Accounts
    echo =============
    echo.
    echo [1] Log In
    echo [2] Sign Up
    echo [3] Exit
    echo.
    set /p op=
    if %op%==1 goto 1
    if %op%==2 goto 2
    if %op%==3 goto 3
    goto error
    :2
    cls
    echo Sign Up
    echo ======================================
    echo.
    set /p newname="Enter new username:"
    if "%newname%"=="%newname%" goto inputname
    :inputname
    cd "%userprofile%\documents"
    if exist "cmdacoBin" goto skip
    if not exist "cmdacoBin" goto noskip
    :noskip
    md "cmdacoBin"
    goto skip
    :skip
    cd "%userprofile%\documents\cmdacoBin"
    if exist "%newname%.bat" goto namexist
    if not exist "%newname%.bat" goto skip2
    :skip2
    echo set realusername=%newname%> "%newname%.bat"
    goto next
    :next
    echo.
    set /p pswd=Enter new Password:
    if "%pswd%"=="%pswd%" goto inputpass
    :inputpass
    cd "%userprofile%\documents\cmdacoBin"
    echo set password=%pswd%>> "%newname%.bat"
    goto next1
    :namexist
    echo.
    echo The entered username already exists.
    echo Press any key to return. . .
    pause >nul
    goto 2
    :next1
    cls
    echo Cmd Accounts
    echo ============
    echo.
    echo Your account has been successfully created!
    echo.
    pause
    goto home2
    :1
    color 07
    cls
    echo Cmd Accounts Log In
    echo ================================
    echo.
    Set /p logname=Username:
    if "%logname%"=="%logname%" goto 2.1
    :2.1
    echo.
    set /p logpass="Password:"
    if "%logpass%"=="%logpass%" goto login
    :login
    cd "%userprofile%\documents\cmdacoBin"
    if exist "%logname%.bat" goto call
    if not exist "%logname%.bat" goto errorlog
    :call
    call "%logname%.bat"
    if "%password%"=="%logpass%" goto logdone
    goto errorlog
    :errorlog
    color 0c
    echo.
    echo Username or Password incorrect.
    echo Access denied.
    pause >nul
    goto home2
    :logdone
    cls
    echo Command Prompt
    echo ==============
    echo.
    echo Successfully logged in!
    echo.
    pause
    goto account
    :account
    cls
    cd "%userprofile%\documents\cmdacoBin"
    call "%realusername%color.bat"
    call "%realusername%.bat"
    color %colorcode%
    cls
    echo.
    echo -------------------------------------------------------------------------------
    echo %realusername%
    echo -------------------------------------------------------------------------------
    @echo off
    break off
    Title Command Prompt
    color 0a
    cls

    echo Type "home" any time to go to the current user profile directory.
    echo Type "desktop" any time to go to the current user desktop.
    echo.
    echo Type help to see list of common commands like cd, rd, md, del,
    echo ren, replace, copy, xcopy, move, attrib, tree, edit, and cls.
    echo Type [command]/? for detailed info.
    echo.
    pause
    cls

    :cmd
    echo Directory: %CD%
    set /P CMD=Command:
    if "%CMD%" == "cls" goto cls
    if "%CMD%" == "home" goto home2
    if "%CMD%" == "desktop" goto desktop
    if "%CMD%" == "red" goto red
    if "%CMD%" == "green" goto green
    if "%CMD%" == "normal" goto normal

    %CMD%
    cd C:\
    goto cmd

    :cls
    cls
    goto cmd

    :home2
    cd /d %USERPROFILE%
    cls
    goto cmd

    :desktop
    cd /d %SystemDrive%\Users\%USERNAME%\Desktop
    cls
    goto cmd

    :red
    color 0c
    cls
    goto cmd

    :green
    color 0a
    cls
    goto cmd

    :normal
    color 07
    cls
    goto cmd

    :crasher

    :A
    @echo off
    Title Website Crasher
    echo Enter the website you would like to crash
    set input=
    set /p input= Enter your Website here:
    if %input%==home goto home

    if %input%==goto A if NOT Becho Processing Your request
    ping localhost>nul
    echo To end Crashing press CTRL + C
    ping localhost>nul
    cls
    echo ----------------------------------------------------------------------
    echo Now Crashing Website...DO NOT CLOSE THIS BOX!! PRESS CRTL + C TO END!!
    echo ----------------------------------------------------------------------
    ping %input% -t -l 1000
    goto menu

    :ff
    Title Mozilla Firefox Options
    echo [1] Google Search
    echo [2] Website Opener
    echo [3] Exit
    echo.
    set /p op=
    if %op%==1 goto mfgs
    if %op%==2 goto ffwo
    if %op%==3 goto 3
    if %op%==un goto un
    if %op%==gc goto gc
    if %op%==ie goto ie
    if %op%==home goto home
    if %op%==codes goto codes
    goto error

    :ffwo


    @echo off 
    Title Website Opener (Firefox)
    echo Enter the website you would like to open (Firefox)
    set input= 
    set /p input= : 
    if %input%==goto A if NOT B 
    echo Processing Your request 
    echo ---------------------------------------- 
    start firefox http://%input%
    goto home

    :womf

    @echo off 
    Title Website Opener (Firefox) 
    echo Enter the website you would like to open (Mozilla Firefox)
    set input= 
    set /p input= : 
    if %input%==goto A if NOT B 
    echo Processing Your request 
    echo ---------------------------------------- 
    start firefox http://%input%
    goto home



    :ie
    Title Internet Explorer Options
    echo [1] Google Search
    echo [2] Website Opener
    echo [3] Exit
    echo.
    set /p op=
    if %op%==1 goto 10
    if %op%==2 goto 20
    if %op%==3 goto 30
    if %op%==un goto un
    if %op%==gc goto gc
    if %op%==ie goto ie
    if %op%==codes goto codes
    goto error

    :10

    @echo off
    Title Google Search (Internet Explorer) 
    set "sc="
    set /p "SC=Type what you want to google (Internet Explorer): "
    if not defined SC goto menu 
    start "" /b "C:\Program Files\Internet Explorer\iexplore.exe" "http://www.google.com/search?q=%SC: =+%"
    pause
    goto home

    :20

    @echo off 
    Title Website Opener (Internet Explorer)
    echo Enter the website you would like to open
    set input= 
    set /p input= : 
    if %input%==goto A if NOT B 
    echo Processing Your request 
    echo ---------------------------------------- 
    start iexplore http://%input%
    goto home






    :gc
    Title Google Chrome Options
    echo [1] Google Search
    echo [2] Website Opener
    echo [3] Exit
    echo.
    set /p op=
    if %op%==1 goto 1
    if %op%==2 goto 2
    if %op%==3 goto 3
    if %op%==un goto un
    if %op%==gc goto gc
    if %op%==ie goto ie
    if %op%==codes goto codes
    goto error

    :1

    @echo off
    Title Google Search (Google Chrome)
    set "sc="
    set /p "SC=Type what you want to google (Google Chrome): "
    if not defined SC goto menu 
    start "" /b "C:\Program Files\Google\Chrome\Application\chrome.exe" "http://www.google.com/search?q=%SC: =+%"
    pause
    goto home

    :mfgs

    @echo off
    Title Google Search (Firefox)
    set "sc="
    set /p "SC=Type what you want to google (Firefox): "
    if not defined SC goto menu 
    start "" /b "C:\Program Files\Mozilla Firefox\firefox.exe" "http://www.google.com/search?q=%SC: =+%"
    echo Processing Your request 
    echo ---------------------------------------- 
    pause
    goto home

    :2

    @echo off 
    Title Website Opener ( Google Chrome)
    echo Enter the website you would like to open (Google Chrome)
    set input= 
    set /p input= : 
    if %input%==goto A if NOT B 
    if %input%==home goto home 
    echo Processing Your request 
    echo ---------------------------------------- 
    start chrome http://%input%
    goto home

    :exit
    exit

    :un
    echo Website Unblocker Options
    echo =============
    echo.
    echo [1] Internet Explorer
    echo [2] Google Chrome
    echo [3] Firefox
    echo [4] Exit
    echo.
    set /p op=
    if %op%==1 goto iex
    if %op%==2 goto goc
    if %op%==4 goto exit
    if %op%==3 goto ffun
    if %op%==un goto un
    if %op%==gc goto gc
    if %op%==ie goto ie
    if %op%==codes goto codes
    if %op%==home goto home
    goto error

    :speedup
    goto 111

    :111
    ipconfig | findstr /i "Gateway"
    echo --------------------------------------
    goto 222

    :222
    echo --------------------------------------------
    echo  GET THE "DEFAULT GATEWAY" NUMBER ABOVE 
    echo --------------------------------------------
    echo TYPE THAT NUMBER FOLLOWED BY ENTER BELOW 
    echo ( MAKE SURE IT HAS THE PERIODS BETWEEN THE NUMBERS TOO, IT HAS TO BE EXACT )
    echo -----------------------------------------------------------------------------
    set input= 
    set /p input= TYPE THE NUMBER IN NOW: 
    if %input%==goto A if NOT B 
    if %input%==home goto home
    echo Starting
    echo ---------------------------------------- 
    start "THIS SPEEDS UP YOUR INTERNET. KEEP THIS MINIMIZED" cmd /c ping -t -l 65500 %input%
    msg * KEEP THIS NEW WINDOW MINIMIZED. THIS IS WHAT SPEEDS UP YOUR INTERNET
    goto home


    :iex

    @echo off 
    Title Website Unblocker (Internet Explorer)
    echo Enter the website you would like to open
    set input= 
    set /p input= : 
    if %input%==goto A if NOT B 
    if %input%==home goto home 
    echo Processing Your request 
    echo ---------------------------------------- 
    start iexplore http://webmoha200.appspot.com/%input%
    goto home

    :goc

    @echo off 
    Title Website Unblocker (Google Chrome) 
    echo Enter the website you would like to open
    set input= 
    set /p input= : 
    if %input%==goto A if NOT B 
    if %input%==home goto home
    echo Processing Your request 
    echo ---------------------------------------- 
    start chrome http://webmoha200.appspot.com/%input%
    goto home

    :ffun

    @echo off 
    Title Website Unblocker (Google Chrome) 
    echo Enter the website you would like to open
    set input= 
    set /p input= : 
    if %input%==goto A if NOT B 
    echo Processing Your request 
    echo ---------------------------------------- 
    start firefox http://webmoha200.appspot.com/%input%
    goto home

    :error
    @echo
    echo I am sorry but the request typed is invalid. To return home push 1

    :codes
    echo ----------------------------------------------------------------------
    echo TO USE TYPE ANY OF THESE CODES ON ANY PAGE TO GO DIRECTLY TO THAT PAGE
    echo ----------------------------------------------------------------------
    echo home= home menu               =
    echo ie= Internet Explorer options =
    echo gc= Google Chrome options     =
    echo un= Website Unblocker options =
    echo ------------------------------=
    set /p op=
    if %op%==home goto home
    if %op%==un goto un
    if %op%==gc goto gc
    if %op%==ie goto ie
    if %op%==codes goto codes




    Tuesday, April 5, 2016 12:41 PM

Answers

  • If anyone would convert them then I will add their name in the application. I know its a lot, so thanks for any reply:

    Batch, VBScript, HTA and PowerShell are radically different scripting languages. You cannot "convert" one to the other. You need to rewrite the code from scratch. Expecting a stranger to familiarise himself with the 530 lines of your batch code (with 143 "goto" statements that exist in batch files only), then writing the new code is somewhat unrealistic. This would be a nice project for you to learn PowerShell.
    Wednesday, April 6, 2016 4:05 PM

All replies