1.

Solve : Batch File Issue?

Answer»

How do we include supporting FILES in batch file. Suppose i have created batch file and i need some files like .exe files and pictures to be included in it and if i created exe of batch i should get an option to include all the supporting files to make the batch file a complete set . So if user downloads the batch file then even the supporting files should go with it.

Secondly suppose i have downloaded the batch file in the system anywhere and i want batch file should automatically take up the path where i have downloaded the file. How do we get that.

Please help me guys i am STUCKED very badly. Holy RED Batman!  That is super annoying.

If you want to publish this for other people to download and use, why don't you just put all the files in a ZIP file or a SELF extracting zip file.

In regards to your second QUESTION.  The path to where the batch file is this variable.
Code: [Select]%~dp0 Quote from: aakashraj47 on September 24, 2014, 01:06:39 AM

How do we include supporting files in batch file.

Encoding the binaries into the batch script is one option.

Quote
i want batch file should automatically take up the path where i have downloaded the file.

Can you explain what you mean by that?


Quote
Secondly suppose i have downloaded the batch file in the system anywhere and i want batch file should automatically take up the path where i have downloaded the file. How do we get that.

Batch automatically makes the current directory that of the batch file as it is run.  If you want reference that in your code, you can have a 'set home=%cd%' command at the beginning, or you can use '%~pd0' if you don't use the 'shift' command in your script. Quote from: Lemonilla on September 24, 2014, 08:40:34 AM
Batch automatically makes the current directory that of the batch file as it is run.

It does, except if you elevate PERMISSIONS when the c:\windows\system32 folder becomes the working directory.General Reference for BAT files:
Information on batch files  (CH)


Discussion

No Comment Found