0002-TIPS swap names of 2 files (same dir)

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
mikecosterus
Junior Member
Junior Member
Posts: 22
Joined: 2003-04-13, 08:23 UTC
Location: Austria

0002-TIPS swap names of 2 files (same dir)

Post by *mikecosterus »

This Button TIP swaps the names of 2 selected files in the same directory:

you can copy this in your DEFAULT.BAR and change the number X in the next available one...

buttonX=shell32.dll,66
cmdX=[specify your dir\]swap.bat
iconicX=-1
paramX=%L
menuX=SWAP names of 2 files


create (SHIFT-F4) the swap.bat in the [specify your dir\] used in cmdX and copy this in it:

@echo off
set f1=
for /f "tokens=* delims=*" %%a in (%1) do (
If not defined f1 set f1=%%a
set f2=%%a)
ren "%f1%" s
move "%f2%" "%f1%"
move s "%f2%"


Save everything and test!

NOTE: This swap feature doesn't work with filenames/directories with Extended ASCII characters (character codes 128 - 255).
If I have a fix, I'll let y'all know. If you have a fix, let ME know! :lol:

MIKE

P.S.: Tell me, is it possible to assign a short-cut key to a button??
I bought Perfect Keyboard Pro (www.pitrinec.com/pkindex.htm) to work faster then any mouse-man, but TC internal shortcuts would be nice
Gregory
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-08, 10:04 UTC
Location: Kiev, Ukraine

Re: 0002-TIPS swap names of 2 files (same dir)

Post by *Gregory »

mikecosterus wrote: Tell me, is it possible to assign a short-cut key to a button??
You can just put this command to Start menu and assign a shortcut to that menu entry.

You can do it in two ways:

1. Just assign hotkey in 'Change start menu' dialog. You can access only Ctrl+Alt+Fn and Ctrl+Alt+Shift+Fn shortcuts there.

2. Or you can assign hotkey to cm_usermenuX command. X is a number of that entry in Start menu.
mikecosterus wrote: I bought Perfect Keyboard Pro (www.pitrinec.com/pkindex.htm) to work faster then any mouse-man, but TC internal shortcuts would be nice
Try Windows PowerPro. It's free
User avatar
mikecosterus
Junior Member
Junior Member
Posts: 22
Joined: 2003-04-13, 08:23 UTC
Location: Austria

Post by *mikecosterus »

Can you imagine...I never used the Start Menu :oops: shame...
I guess I have to get more into 5.51...I'm still thinking I'm using WC3 :wink: (loooong time ago, BEFORE the purchase)

Thnx for waking me up. MIKE
User avatar
za222
Member
Member
Posts: 146
Joined: 2003-03-11, 17:19 UTC
Location: Germany

Post by *za222 »

Important:
It doesn't work if there are spaces at the ends of the lines in the batch-file!
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 13-04-2003 22:35:06 +0000 mikecosterus wrote:

m> Can you imagine...I never used the Start Menu

From v.5.51 it has a new functionality.[/face]
User avatar
mikecosterus
Junior Member
Junior Member
Posts: 22
Joined: 2003-04-13, 08:23 UTC
Location: Austria

Post by *mikecosterus »

2 ZA222: CORRECT!
I was unable to delete the spaces at the end of the code(phpbb glitch?),
not even with the

Code: Select all

 attribute..
so if you COPY this the code..remove the spaces at the end!
Sorry for the inconvenience....

MIKE
BTW: How long did it take you 2 figure that out???? :shock:
User avatar
za222
Member
Member
Posts: 146
Joined: 2003-03-11, 17:19 UTC
Location: Germany

Post by *za222 »

BTW: How long did it take you 2 figure that out????
It took about 5 minutes. First I removed the "@echo off" at the first line and insterted "pause" at the end.
Then I saw that the batch wanted to rename sth. to " "
Post Reply