Search found 15 matches
- 16 Mar 2018 10:17
- Forum: DOS Batch Forum
- Topic: Rename files and add a suffix with TimeStamp
- Replies: 5
- Views: 5551
Re: Rename files and add a suffix with TimeStamp
Hi, i found the solution!! :-) Thanks! @ECHO OFF setlocal enabledelayedexpansion REM Change the working directory PUSHD "C:\Test\aa" REM Get all files with an extension for %%G in (*.*) do ( REM add prefix with time and date set "name=%%G%time:~0,2%%time:~3,2%%time:~6,2%_%date:~-10,2%%date:~-7,2%%da...
- 16 Mar 2018 08:29
- Forum: DOS Batch Forum
- Topic: Rename files and add a suffix with TimeStamp
- Replies: 5
- Views: 5551
Re: Rename files and add a suffix with TimeStamp
Hi, thanks, for reply. I have read the post you have linked but I'm not an expert :( It's ok put the date and time like a suffix or the data and time of creation of the file. (that maybe it's easier) The only important thing that all the file have a specific name before moving into other folder. If ...
- 16 Mar 2018 03:48
- Forum: DOS Batch Forum
- Topic: Rename files and add a suffix with TimeStamp
- Replies: 5
- Views: 5551
Rename files and add a suffix with TimeStamp
Hi, I have this code to rename file without spaces and move from C:\Test\aa to C:\Test\aa\tmp I need to add at the end the suffix with time stamp setted in _YYYYMMDD_HHMMSS. For example: C:\Test\aa\FileA.dat C:\Test\aa\FileB.txt C:\Test\aa\FileC.jpg to C:\Test\aa\tmp\FileA_20180316_104210.dat C:\Tes...
- 02 Jan 2018 08:25
- Forum: DOS Batch Forum
- Topic: Rename files on FTP folder (without download and re-upload)
- Replies: 1
- Views: 2480
Rename files on FTP folder (without download and re-upload)
Hi, I've a question. I should rename and delete a name prefix of the files on a ftp server. I must do it without download and reupload files on server but do it directly on server. For example: ftp.mysite.com\project\temp\Upolad_Test1.txt ftp.mysite.com\project\temp\Upolad_Test2.txt ftp.mysite.com\p...
- 29 Dec 2017 09:27
- Forum: DOS Batch Forum
- Topic: Remove space ad add prefix to all files in a folder
- Replies: 13
- Views: 9957
Re: Remove space ad add prefix to all files in a folder
It works!
Thank you very much!
Have a nice day and happy new year!
Francesco
Thank you very much!
Have a nice day and happy new year!
Francesco
- 29 Dec 2017 08:49
- Forum: DOS Batch Forum
- Topic: Remove space ad add prefix to all files in a folder
- Replies: 13
- Views: 9957
Re: Remove space ad add prefix to all files in a folder
Hi, the folder and the file are correct and into correct place. Into folder c:\project\temp there are: test.bat (with the code), Pre_aaaa.jpg and Pre_qqqq.jpg When the batch run i get this, and after no file are moved and renamed. ___ C:\project\temp>for %i in ("*.*") do if /I "%~xi" NEQ ".bat" (set...
- 29 Dec 2017 08:02
- Forum: DOS Batch Forum
- Topic: Remove space ad add prefix to all files in a folder
- Replies: 13
- Views: 9957
Re: Remove space ad add prefix to all files in a folder
Thanks for help.
the renaming works well but not the moving of the file.
After process no files has been moved.
Can you help me?
Thanks,
Francesco
the renaming works well but not the moving of the file.
After process no files has been moved.
Can you help me?
Thanks,
Francesco
- 29 Dec 2017 07:32
- Forum: DOS Batch Forum
- Topic: Remove space ad add prefix to all files in a folder
- Replies: 13
- Views: 9957
Re: Remove space ad add prefix to all files in a folder
Hi, thank you very much.
Only a little problem, the circle don't work.
The program rename and move just one file.
Can you help me again?
Thanks in advance,
Francesco
Only a little problem, the circle don't work.
The program rename and move just one file.
Can you help me again?
Thanks in advance,
Francesco
- 29 Dec 2017 05:42
- Forum: DOS Batch Forum
- Topic: Remove space ad add prefix to all files in a folder
- Replies: 13
- Views: 9957
Re: Remove space ad add prefix to all files in a folder
I tried with this but it doesn't work
Can you help me?
Code: Select all
for %%i in ("*.*") do (set fname=%%i) & call :rename
goto :eof
:rename
::Cuts off 1st four chars
ren "%fname%" "%fname:~4%"
goto :eof
- 29 Dec 2017 02:55
- Forum: DOS Batch Forum
- Topic: Remove space ad add prefix to all files in a folder
- Replies: 13
- Views: 9957
Re: Remove space ad add prefix to all files in a folder
Hi, can you please help me again? :-) I’ve to create another procedure to remove the prefix “Pre_” to all file in folder “C:\Project\Temp\” and move to folder “C:\Project\Save\”. Example: C:\Project\Temp\Pre_File1.jpg C:\Project\Temp\Pre_File2.doc C:\Project\Temp\Pre_File3.txt Result: C:\Project\Sav...
- 21 Dec 2017 05:03
- Forum: DOS Batch Forum
- Topic: Remove space ad add prefix to all files in a folder
- Replies: 13
- Views: 9957
Re: Remove space ad add prefix to all files in a folder
You are super! Thank you very much!!
- 20 Dec 2017 10:58
- Forum: DOS Batch Forum
- Topic: Remove space ad add prefix to all files in a folder
- Replies: 13
- Views: 9957
Remove space ad add prefix to all files in a folder
Hi, I’ve an issue with a batch file. I would create a batch for: In a folder es C:\origin I have a lot of file like: Aa 1234.txt bb 3456.jpg cc122 443.doc Ddeeff gg.xls the program should move the file to C:\origin\temp and remove the space from the name of file and add a prefix “Pre_” before name. ...
- 27 Feb 2015 11:02
- Forum: DOS Batch Forum
- Topic: Condition of entry into "IF" and exit
- Replies: 11
- Views: 6548
Re: Condition of entry into "IF" and exit
Now it works perfectly!
Thanks so much for the help!
Thanks so much for the help!
- 26 Feb 2015 03:04
- Forum: DOS Batch Forum
- Topic: Condition of entry into "IF" and exit
- Replies: 11
- Views: 6548
Re: Condition of entry into "IF" and exit
Thank you very much Squashman! Let me explain better The program is designed to prepare the files for a simple application of my family business. 1) counts the files in the folder "C: \ Test" and save the nuemro in the variable "cnt" 2) if there is only one file, then copy it to ...
- 25 Feb 2015 06:21
- Forum: DOS Batch Forum
- Topic: Condition of entry into "IF" and exit
- Replies: 11
- Views: 6548
Condition of entry into "IF" and exit
Hello everyone ! I'm new to this forum but I thank in advance anyone help me .. I am writing to ask for help ... I need to create a .Bat file that performs the following tasks: If in the folder there is only .txt files I have to play the first "IF" if there are more than one then I have to...