Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Lost RecoverEmbed Source Script WBT WIL Code Compiled EXE Large Complete Other Files ExtractAttachedFile
In your source code, you will need to add some code to determine when to extract the source code. It could be either triggered by the existence of a particular file in the same directory as the EXE or via commandline.
The commandline trigger code might look something like this:
; Handle commandline input ; If user passes the commandline 'source' to the exe the .wbt file will be extracted tot he same directory as the exe. If param0 > 0 If param0==1 If StrLower(param1)=="source" ExtractAttachedFile("main.wbt", "main.wbt") EndIf EndIf EndIf ; Main code Pause('Sample Source Extract', 'Pass the commandline parameter "source" to extract the source code') For x = 1 To 100 Yield() Next ExitNow its time to compile your script.
Now if you run the Main.exe with no commandline parameters, the source code will not extract. If you pass th single commandline parameter "source" to the main exe the maint.wbt file should extract to the same directory as the Main.exe.
"C:\temp\Main.exe" "source"
Article ID: W17695
Filename: How to Embed Source Code.txt
File Created: 2013:04:05:11:51:52
Last Updated: 2013:04:05:11:51:52