Create a batch file to update an exe file over FTP - file

I need to update an exe file on a daily basis, did create a batch file and used the 'fc' command which worked like a charm but i have two issues.
1) The newer version of the exe file would be located on an FTP site
2) The location of the older exe file would not be fixed.
The older exe file is a single executable and the problem is the user can save it anywhere, need a command so that i can locate that file compare it with the file on the FTP site and update that file if needed.
I am new to this, any help is greatly appreciated.

well you can avoid all of this by using a briefcase then put the file that you want to update into the briefcase and then run the update manually.
but if you really want to do it with a batch file then
#echo off
cls
replace (file being updated) (updated file)
exit

Related

I want to create .exe file to create multiple folder at a same time

I want to create .exe setup or batch file to create Multiple folders at same time.
and folder name prompt to give or take from .txt file.
If you are ok to enter the name of the folder each time, you can simply use the md command of the Windows Command Line!
Syntax: md MyFolderName
Your question is Operating system dependent.
To create an executable
In windows you can use Visual Studio console application to create a c++ code and build it to obtain a .exe file. You have to take care on the linking options.
To create a directory simply do mkdir("foldername") and to read or write from txt file, create a file stream and use getline to read the names of folder.
In linux I suppose it can be done by writing a bash script.

Batch File Rename - Batch File needs to move from folder to folder

New to batch file writing. We are unable to install a file renamer program at work so i am looking to find a way to create a batch file to do the job instead. I want to create a batch file that i can place in a folder and it will rename all files in that folder with a prefix, while deleting some text from the file name itself. I am happy to edit the prefix text (as it changes all the time) in Notepad each time but I need to be able to move the batch file to the different folders.
The files will be something like this RDS_117856.pdf
and they need to read as xxx-xxx-xxx-117856.pdf
Any help would be great.
I am using windows, only have access to Notepad and no other coding software so a .BAT file would be the easiest thing to create here.

pass execution path of sfx to batch file

So basically i want to wrap my batch file in an sfx to make a tidy package as I am using multiple files that need to be packaged with the batch file. The problem I am facing is that I need drag and drop functionality so I need to somehow pass the file dropped on the sfxz to the batch file via the execution code.
I am using the winrar default sfx module.
So far I have tried passing it with the %~1 variable but that just passes literally %~1 instead of the location of the dropped file
Any help will be appreciated.
You can use BHX from here to encode the binaries into the batch file, so it is just one file to distribute. http://www.dostips.com/forum/viewtopic.php?f=3&t=4104

Need to write a batch file job

I need to write a batch job file to keep two folder in sync.
Inputs : Source and Destination folder names.
senario :
If the destination folder/subfolder is not found – create and proceed
If the files are already present in both the folders Compare and overwrite destination file if timestamp/size differs.
If the file not present in source and present in destination, delete the destination file.
kindly help me to write the batch job.
Thanks Vikram
A batch file written by a self-professed inexperienced user - even run periodically - is not a good replacement for a sync tool like rsync or dropbox or even the Briefcase built into Windows. Robocopy looks a good bet.

batch script to find a particular folder in a drive

am a newbie to the batch script, i have many folders called LIB in my drive
say it can be as LIB_data,lib,lib_ac anything that starts with lib or LIB... i want to list all these directories and sort them in which they have created in the pc and copy the latest directory contents to BATCH_LATEST_LIB_FILES folder,that will be a new folder created by this batch file.i want this new folder to be created in the path where this batch file is present. please help me with a batch script.
You might look at FOR, DATE, TIME, SORT, IF, GOTO and XCOPY.
This site is a great resource for batch files.

Resources