Sign in to follow this  
Followers 0
bobheart

Embedded files

16 posts in this topic

I understand you can embedded a image file in the exe . Can you embedded any other files ? Like a bat file etc ?

And how do you do it ? I need to see how it is done with a little code if you please .

Thank you .

Share this post


Link to post
Share on other sites



Never mind I got it ..

FileInstall("test3232.bat", "test3232.bat")
RUN("test3232.bat")

I figure it out on my own .. :ph34r:

Share this post


Link to post
Share on other sites

This is what it looks like now . :ph34r:

FileInstall("test3232.bat", "test3232.bat")
RunWait("test3232.bat","",@SW_HIDE)
FileDelete("test3232.bat")

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Embed a .bat file sounds quite stupid to me.

The only reason for wanting something like this is that you need modify it easily anytime before compiling that I guess it is not the case.

I think is stupid because is much better IMNSHO just create it with a FileWrite() func.

E.g.

;I made a new line every new line of the .bat for readability... It is not needed
FileWrite("test3232.bat",_
":: this is my bat file" & @crlf & _
"Cls" & @crlf & _
"dir" & @crlf & _
"::ect")

RunWait("test3232.bat","",@SW_HIDE)
FileDelete("test3232.bat")
Edited by ezzetabi

Share this post


Link to post
Share on other sites

When someone does something that they have never done before how can you call it stupid ?

Did I say I was going to use it ? no so !

Share this post


Link to post
Share on other sites

I said that it sounded stupid to me, not that you are stupid.

Anyway, sorry I really didnt mean to offend anyone.

Share this post


Link to post
Share on other sites

Can u embed an exe file in an exe ?

This could come in handy ! I hate having to have one exe present for another to run !

Share this post


Link to post
Share on other sites

Can u embed an exe file in an exe ?

This could come in handy ! I hate having to have one exe present for another to run !

You can embed any file.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Ok lets say u have a autoit exe called A.exe and u have another autoit exe file B.exe embedded into it so as it appears to be one exe.

When A is run how would u extract B.exe to say the c:/

Edited by nova

Share this post


Link to post
Share on other sites

RTFM

FileInstall()

Share this post


Link to post
Share on other sites

OK srry I miss understood U use

#include to embed a file

and

file install to extract it

One other thing what the hell dose

RTFM

mean ?

Share this post


Link to post
Share on other sites

RTFM is short for "Read The Fucking Manual"

Share this post


Link to post
Share on other sites

Wow ezzetabi relax man !

By the way I cant RTFM at the moment cause IIFW (Im in fucking work)

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

#include to embed a file

and

file install to extract it

No. #include is only used to include an AutoIt source. FileInstall is the only way to include a file. The fine will be embeded in the script when it is compiled, and extracted to the destination path when the line is executed in the code.

[Edit] Why can't you read the manual at work? they don't let you download any files at work? You can just download the chm helpfile and double click on it...

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I actually dislike the use of #include I prefere copy the functions' code I need to the botton of the script, but as pekster said it is not the same of file install.

FileInstall() is needed to embed a file compiling time, when the script arrive to the FileInstall() line it extract the file to the destination for any use.

Usually it is used to messing with command line programs in hidden windows. Since you can never know if the computers the script will work have or not the program you need you just FileInstall it,use it and delete it.

The deletion is of course not automatic, so it is a good idea be careful and delete anything.

If the fileinstall happen at the begin of the script because the installed program is needed often I usually make a special _Terminate func that deletes all installed files before Exit and I use it anytime I should need a Exit.

E.g.

I copyed psexec.exe just before compiling in c:\Fileinstall\psexec.exe

FileInstall("c:\FIleInstall\psexec.exe",@tempdir & "\",1);Fileinstall want the trailing \

RunWait(@tempdir & "\psexec \\* cmd /c chkdsk c: /f","",@SW_HIDE)

_Terminate()

Func _Terminate()
   FileDelete(@temp & "\psexec.exe"
   Exit
EndFunc

BTW I know I need to relax... but I am quitting my job for a new life and I am quite worried...

Edited by ezzetabi

Share this post


Link to post
Share on other sites

BTW I know I need to relax... but I am quitting my job for a new life and I am quite worried...

Never mind man just seemed a little harsh but I know how its annoying when ppl ask simple questions and it seems there just too lazy to look up the help file !

I just didnt want to have to wait till I got home before checking it !

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  
Followers 0