Jump to content
Sign in to follow this  
Kronitron

Batch File to AutoIT

Recommended Posts

Kronitron

I found a batch file online that I'd like to turn it into an .exe file though AutoIT.  I've done tons of research and tried many things, but I just don't have the coding know-how to pull it off.  Can anyone do it for me?  Or at least point me in the right direction?

Here it is:

cls
@ECHO OFF
title Folder Private
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private "HTG Locker"
attrib +h +s "HTG Locker"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== PASSWORD_GOES_HERE goto FAIL
attrib -h -s "HTG Locker"
ren "HTG Locker" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End


[post='1192322']Detect and Switch Monitor Orientation[/post]

Share this post


Link to post
Share on other sites
JustSomeone

First of all, wellcome to the AutoIT forums :) 

Do you want to run it via command prompt or completly migrate it to autoit ? Did you coded something so far , and if yes may we see your progress? Also, personal opinion is that using +h +s as attribute in order to "hide" it is not secure at all.

In the autoit help file you will find everything required to migrate this to autoit, post some code and i will be glad to help.

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, Kronitron, welcome to the forum. Please note that we operate under the "teach a man to fish" motto, rather than spoon-feeding code. Below are some suggestions to get you started. Why don't you try your hand at beginning the code, then post what you have here (even if it isn't working)? We'll be happy to help you refine it.

title Folder Private - Look at WinSetTitle in the help file
 
If EXIST "HTG Locker"... - Look at FileExists in the help file
 
goto UNLOCK - There is no GOTO in AutoIt (Thank God), look at the Function reference in the help file
echo...Look at MsgBox in the help file


   The MsgBox section of the help file will also show you how to call a function based on the response.

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
Kronitron

Hi guys,

Thanks for the responses.  I decided to use true crypt instead of going through AutoIT.  I didn't want to because truecrypt has been discontinued, but it serves my purposes well enough. 

-Enjoy


[post='1192322']Detect and Switch Monitor Orientation[/post]

Share this post


Link to post
Share on other sites
BrewManNH

Anything would be better than that batch file, all that batch file does is add the hidden and system attributes to a folder, there's absolutely no security in it at all.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Kronitron

I know it isn't secure, but I wasn't really trying to secure it.  There were some files I wanted to keep in a particular folder but out of my wife's hands.  Nothing bad, just videos of some friends she despises.  She wouldn't even be able to begin to figure out how to get into the folder.  I just needed the guise of security, but true crypt was simpler.


[post='1192322']Detect and Switch Monitor Orientation[/post]

Share this post


Link to post
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
Sign in to follow this  

×