Search found 7 matches

by Gunner
16 Dec 2019 07:27
Forum: DOS Batch Forum
Topic: use for loop to set local variable
Replies: 2
Views: 1417

Re: use for loop to set local variable

Thanks for the reply and explanation - all working nowq
by Gunner
16 Dec 2019 05:18
Forum: DOS Batch Forum
Topic: use for loop to set local variable
Replies: 2
Views: 1417

use for loop to set local variable

Hi Within my .bat file I want to get the name of the only file in a folder (I am guaranteed that there will only ever be 1 file) I have tried this set fn="a" for /r %%i in (*) do set %fn% = %%~nxi but fn is not set as expected First question: why not and how can I fix Second question : this seems a ...
by Gunner
16 Dec 2019 05:16
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 2364

Re: Using the rename command

Thanks
How do I close the question?
by Gunner
16 Dec 2019 04:19
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 2364

Re: Using the rename command

Thanks - this is what I was looking for
by Gunner
16 Dec 2019 02:08
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 2364

Re: Using the rename command

Ok let me clarify
Given a file name of

Encoder_TestHarnessLog_19_12_13-113027.xml

I want to generate a filename of

Test1_19_12_13-113027.xml

Where Test1 can be any string (ultimately a command line argument to a batch script

I hope this is clearer
by Gunner
13 Dec 2019 05:43
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 2364

Re: Using the rename command

HI thanks
you are correct
I need to retain the date stamp ant the on the end of the original and include it it the second
by Gunner
13 Dec 2019 03:03
Forum: DOS Batch Forum
Topic: Using the rename command
Replies: 9
Views: 2364

Using the rename command

Hi
I have a file named Encoder_TestHarnessLog_19_12_13-083023.xml that I want to rename Test1_19_12_13-083023.xml from within a batch file
but cant see to Achieve this with the rename command.
Please can someone suggest a way of doing this?