It is currently Thu Jun 07, 2018 9:05 pm

All times are UTC - 8 hours [ DST ]


Forum rules


Please, keep discussions on topic and in the right forum. The start menu topics go into the Classic Start Menu forum, etc. This makes it easier for people to locate topics they are looking for.
If you get a satisfactory response to your question, please mark the topic as "solved". Click the green √ button in the bottom-right of the post.



Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Sun Mar 03, 2013 12:42 pm 
Offline
User avatar

Joined: Sun Mar 03, 2013 12:22 pm
Posts: 7
Hi everyone..

I'm looking for a way or a patch command to rename selected file with a specific word?

Thanks for help.


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 03, 2013 12:49 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5331
Maybe something like "cmd.exe /C ren %2 word.txt"
It will fail if there is already a file with that name.


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 03, 2013 1:56 pm 
Offline
User avatar

Joined: Sun Mar 03, 2013 12:22 pm
Posts: 7
Sorry I'm not pro in these stuff but it didn't work, maybe I did something wrong?

I made 2 files:
rename.bat
word.txt

in rename.bat I put

Code:
cmd.exe /C ren %2 word.txt


I use classic shell custom command button to target that rename.bat file, is that correct?

Thx


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 03, 2013 2:12 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5331
You don't need a bat file. Simply use the command directly in the button.
You don't need word.txt. In fact it will cause the command to fail because it will conflict with the file you are trying to rename.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 1:30 am 
Offline
User avatar

Joined: Thu Feb 21, 2013 11:04 pm
Posts: 463
RenameMaster is an awesome, easy-to-use program that can rename files in many different ways

you can download it here http://www.joejoesoft.com/cms/showpage.php?cid=108


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 1:50 pm 
Offline
User avatar

Joined: Sun Mar 03, 2013 12:22 pm
Posts: 7
I'm sorry, I don't know what I did wrong, I think there is a syntax error?



I select file (1) then I click the button (2)

I want the file name to be "hello" for example.

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 3:25 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5331
If you want the selected file to be renamed to "hello", then replace "word.txt" with "hello".


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 3:33 pm 
Offline
User avatar

Joined: Sun Jan 06, 2013 1:44 pm
Posts: 1939
cmd.exe /C ren "%2" "word.txt"


is what you should have put, he forgot the quotes :P

and as he said replace word.txt with whatever


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 5:23 pm 
Offline
User avatar

Joined: Sun Jan 06, 2013 1:44 pm
Posts: 1939
Why does


C:\Windows\System32\cmd.exe /C cd "%1" && for %a in (*.*) do ren %a AddThis%a
Not work while

C:\Windows\System32\cmd.exe /C cd "C:\Users\Jesse\Desktop\aa" && for %a in (*.*) do ren %a AddThis%a

Works

In the first example its recognizing the first command, and then terminating, while in the second it runs both...


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 5:30 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5331
Not sure. You can run something like Process Monitor to see what the first command really expands to.
However you don't need the cd because the command runs in the current folder anyway.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 04, 2013 6:13 pm 
Offline
User avatar

Joined: Sun Jan 06, 2013 1:44 pm
Posts: 1939
without cd cmd opens to C:\Windows for me..
and with this script this could potentially be very bad XD

the /C part just tells the script to close after running so removal of that shows it opens to the windows dir..

so if you want to see whats happening just remove the /C part :P

EDIT UPDATE: this works if i paste into the address bar, but not as a command on one of your buttons:

C:\Windows\System32\cmd.exe /C cd "%1" & for %a in (*.*) do ren %a AddThis%a


....?


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 05, 2013 8:57 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 02, 2013 11:38 pm
Posts: 5331
It can't work in the address bar because the address bar doesn't know anything about %1


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 05, 2013 10:31 am 
Offline
User avatar

Joined: Sun Jan 06, 2013 1:44 pm
Posts: 1939
yet it does.... maybe windows happens to use the same syntax to get current directory (it seemed kinda familiar to me before classic shell)

but you can try it yourself (i can only confirm for w8pro but i would imagine w7 should work to)

just make a new folder, throw 1-2 files in it (or right-click create new) text, and bitmaps
just make sure the file in the folder doesnt have spaces in the name or it wont work


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 05, 2013 1:13 pm 
Offline
User avatar

Joined: Sun Mar 03, 2013 12:22 pm
Posts: 7
Perfect, thanks.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group, Almsamim WYSIWYG Classic Shell © 2010-2016, Ivo Beltchev.
All right reserved.