Robin Posted October 30, 2008 Posted October 30, 2008 Hi guys 'n dolls...As i mentioned before, i'm new to scripting and have one small fav to ask...I just want to copy/overwrite a autorun.inf file. I compiled a small exe file that has 2 buttons OK and CANCEL...If i click on "cancel", it still overwrites my file...How can i change this? Here is my very simple code--> #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=D:\CD-Menu\test.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** MsgBox(1, "Overwrite", "Overwrite Autorun.inf?", 0) FileCopy ( "autorun.in_", "autorun.inf", 1) ...it looks as if i have to add a "if" function somewhere as it is the FILECOPY that changes it? tia
dbzfanatic Posted October 30, 2008 Posted October 30, 2008 You need to assign the return from messagebox to a variable and look at its value to determine what to do. Read the helpfile. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
FaT3oYCG Posted October 30, 2008 Posted October 30, 2008 $retVal = MsgBox(0x4, "Overwrite?", "Do You Want To Overwrite The Autorun.inf File?"); Yes / No Dialog Box 6=Yes 7=No If $retVal = 6 Then FileCopy ( "autorun.in_", "autorun.inf", 1) EndIf Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.
Robin Posted October 30, 2008 Author Posted October 30, 2008 $retVal = MsgBox(0x4, "Overwrite?", "Do You Want To Overwrite The Autorun.inf File?"); Yes / No Dialog Box 6=Yes 7=No If $retVal = 6 Then FileCopy ( "autorun.in_", "autorun.inf", 1) EndIfBrother...you are my HERO!!! thx a lot...As i said earlier i'm no script-kiddy...use to work with assembler. ...thx FaT3oYCG...much appreciated
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now