Relative Content

Tag Archive for batch-file

Batch file is executed only the first time

I have this batch file that checks if the current working directory is the same as the path provided and if they are the same it doesn’t do anything but if they are different it should change the current working directory to the path provided.

Call file from OneDrive folder using Batch file

I am trying to call an XLSM file using a batch file in a OneDrive folder. But may be due to the dash (or whitespace), it tells me that the file is not found. Below is what I have. Any help is much appreciated. Thanks!

Only allow numbers with set /p command in windows batch

So I’m trying to write a program that ask a number to the user, and once the number is selected it’s written in a .txt file. my problem is, when I use set /p the user could enter letters or symbols too, but i don’t want it to be allowed.
So if the user writes something with a letter and/or a symbol, it should say something like “Not valid, please only use numbers.”
The only case where letters are allowed is if the user types “fin”, wich would end the program.
So my idea was to add a new line where the “rem” lines are (because that’s what i tried but it didn’t work), and it would check if %lot% only has numbers or not. Does someone have an idea of how to proceed ?

Writing filenames into a string using a loop

For a project, i must have a batch script responsible for FTP file uploading.
For easier debuging / letting us know when a problem happens, if ftp upload is unsuccesful, i’d like to send a mail listing the files what were not uploaded.
That is where i got stuck.