Jump to content

How to convert batch code to AutoIT


Skitty
 Share

Recommended Posts

O.K... so I nearly got banned for my last topic and I hope I don't get banned this time... I's there a possible way to convert a batch file to AutoIT?

I have this really cool script I collaborated and would like to convert to AutoIT so I can add more functions and so... Also, after I convert the script to .EXE file extension, how do I embed audio in it so In can have it play every time it executes? I really want to add audio to compiled AutoIT executables but can't find any information anywhere. And in case you're wondering what my last post was, it was about a AutoIT script that would disable and re-enable the windows xp gui and I needed help on creating a gui that would ask for a password and the only reply I recived was from this person who calls himself "big daddy" and then he locked my post so no one could reply. He said, "This sound molicius *CLICK*". but enough about that, and more about the script. here it is.

@echo off
:start0
color 0a
Echo Loading
ping localhost -n 1 >nul
cls
Echo Loading.
ping localhost -n 1 >nul
cls
Echo Loading..
ping localhost -n 1 >nul
cls
Echo Loading...
ping localhost -n 1 >nul
cls
title Terminal service selection interface
echo                            Welcome
echo --------------------------------------------------------------
echo Please select the service you require below.
echo --------------------------------------------------------------
echo.
echo 1 = File security service
echo 2 = Program selection
echo.
echo --------------------------------------------------------------
echo Enter "e"  to exit.
echo --------------------------------------------------------------
echo.
echo Enter the numerical value of the service you require
set /p input=
echo.
if %input%==1 GOTO START
if %input%==2 GOTO START2
if %input%==e GOTO END
cls
color 0c
echo Error: invalid entry
ping 1.0.0.0 -n 1 -w 2000 >NUL
cls
goto start0
:start
cls
Echo Loading
ping localhost -n 1 >nul
cls
Echo Loading.
ping localhost -n 1 >nul
cls
Echo Loading..
ping localhost -n 1 >nul
cls
Echo Loading...
ping localhost -n 1 >nul
cls
color 0a
title Data archiving service
@echo Welcome to MS-DOS data archiving service. 
ping 1.0.0.0 -n 1 -w 2000 >NUL
cls
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Archive goto MDARCHIVE
:CONFIRM
Color 0a
Echo ------------------
echo Lock archive?(Y/N)
echo ------------------
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto B
if %cho%==N goto B
cls
color 0c
echo ERROR: Invalid choice.
ping 1.0.0.0 -n 1 -w 2000 >NUL
cls
goto CONFIRM
:LOCK
ren Archive "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
@echo Folder locked successfully
@pause
goto End
:UNLOCK
color 0a
echo Unlock archive?(Y/N)
set/p "cho=>"
if %cho%==Y goto A
if %cho%==y goto A
if %cho%==n goto B
if %cho%==N goto B
cls
color 0c
@echo ERROR: Invalid choice.
ping 1.0.0.0 -n 1 -w 2000 >NUL 
cls
goto UNLOCK
:A
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Archive
@echo Folder Unlocked successfully
@pause
goto end
:MDARCHIVE
md Archive
@echo Archive created successfully
@pause
goto End
:START2
cls
@echo off
color 0a
Echo Loading
ping localhost -n 1 >nul
cls
Echo Loading.
ping localhost -n 1 >nul
cls
Echo Loading..
ping localhost -n 1 >nul
cls
Echo Loading...
ping localhost -n 1 >nul
cls
color 0a
title program selection interface
echo Welcom MS-DOS program selection interface
ping 1.0.0.0 -n 1 -w 2000 >NUL 
:start3
cls
color 0a
echo --------------------------------------------------------------
echo.
echo 1 = **service** ::Replace (**service**) with the program name you want to run.
echo 2 = **service** ::Replace (**service**) with the program name you want to run.
echo 3 = **service** ::Replace (**service**) with the program name you want to run.
echo 4 = **service** ::Replace (**service**) with the program name you want to run.
echo 5 = **service** ::Replace (**service**) with the program name you want to run.
echo.              ::^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<----Delete this and the above.
echo --------------------------------------------------------------
echo Enter "E" to exit.
echo --------------------------------------------------------------
echo.
echo Enter the numerical value of the service you wish to execute:
echo Enter (E) to exit.
set /p input=
echo.
if %input%==1 start **service** ::Replace (**service**) with the program you want to initiate.
if %input%==2 start **service** ::Replace (**service**) with the program you want to initiate.
if %input%==3 start **service** ::Replace (**service**) with the program you want to initiate. 
if %input%==4 start **service** ::Replace (**service**) with the program you want to initiate.
if %input%==5 start **service** ::Replace (**service**) with the program you want to initiate.
if %input%==e goto end        ::^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<------delete this and the above.
cls
echo ----------------------------------------------------
echo Enter (E) to exit, (B) to select another program.
echo ----------------------------------------------------
echo.
set /p input=
if %input%==e goto b
if %input%==b goto start3
echo.
cls
color 0c
echo Invalid entry
ping 1.0.0.0 -n 1 -w 2000 >NUL
goto start3
:exit
echo. 
:B
cls
@echo Goodbye...
ping 1.0.0.0 -n 1 -w 2000 >NUL 
cls
:END

It's an entertaining little script, hope you have fun! It gave me brain'aids...

Any information welcome.

regards, jslr

http://www.dogpuppypictures.com/images/funny_dog_pictures/funny_dog_picture_3.jpg

Edited by xJSLRx
Link to comment
Share on other sites

You can just run that bat from your script.

echo = consolewrite()

cls can be done ry running cmd /c /cls ( you need to kook ab vars and macos that run() takes)

ping = ping()

goto B = B()

actually run("cmd /c SomeCommand") shuld be able to do ren, attrib and so on.

edited

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...