Classic Shell http://www.classicshell.net/forum/ |
|
Rename selected file with "somethng" http://www.classicshell.net/forum/viewtopic.php?f=8&t=335 |
Page 1 of 1 |
Author: | Elancore [ Sun Mar 03, 2013 12:42 pm ] |
Post subject: | Rename selected file with "somethng" |
Hi everyone.. I'm looking for a way or a patch command to rename selected file with a specific word? Thanks for help. |
Author: | Ivo [ Sun Mar 03, 2013 12:49 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
Maybe something like "cmd.exe /C ren %2 word.txt" It will fail if there is already a file with that name. |
Author: | Elancore [ Sun Mar 03, 2013 1:56 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
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 |
Author: | Ivo [ Sun Mar 03, 2013 2:12 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
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. |
Author: | Tenzen [ Mon Mar 04, 2013 1:30 am ] |
Post subject: | Re: Rename selected file with "somethng" |
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 |
Author: | Elancore [ Mon Mar 04, 2013 1:50 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
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 |
Author: | Ivo [ Mon Mar 04, 2013 3:25 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
If you want the selected file to be renamed to "hello", then replace "word.txt" with "hello". |
Author: | Jcee [ Mon Mar 04, 2013 3:33 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
cmd.exe /C ren "%2" "word.txt" is what you should have put, he forgot the quotes ![]() and as he said replace word.txt with whatever |
Author: | Jcee [ Mon Mar 04, 2013 5:23 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
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... |
Author: | Ivo [ Mon Mar 04, 2013 5:30 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
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. |
Author: | Jcee [ Mon Mar 04, 2013 6:13 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
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 ![]() 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 ....? |
Author: | Ivo [ Tue Mar 05, 2013 8:57 am ] |
Post subject: | Re: Rename selected file with "somethng" |
It can't work in the address bar because the address bar doesn't know anything about %1 |
Author: | Jcee [ Tue Mar 05, 2013 10:31 am ] |
Post subject: | Re: Rename selected file with "somethng" |
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 |
Author: | Elancore [ Tue Mar 05, 2013 1:13 pm ] |
Post subject: | Re: Rename selected file with "somethng" |
Perfect, thanks. |
Page 1 of 1 | All times are UTC - 8 hours [ DST ] |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |