ZTree.com  | ZEN  | About...  

 Index   Back

[Help!] rename function   [Help!]

By: Ben Kent       
Date: Aug 12,2019 at 17:10
In Response to: [Help!] rename function (John Miyamoto)

> The part of the renaming macro that I can't work out is how to have
> the macro ask the user to input the new name of the file. I can hard
> code the new file name into the macro, but obviously this only works for
> one specific file. Is it possible to interrupt a macro to ask the user
> for input, and then to continue processing the macro? I haven't found
> any discussion of a way to get user input in the middle of a macro
> process.


Martijn's solution is the way to go if you want to use a macro.

The other option in ZTree, is to use the F9 application menu, with an item something like this

:: #ZTset NewName New name:
REM Touch the file
copy /b %1,,+
REM Now rename
ren %1 "%NewName%"
If ErrorLevel==1 Echo something went wrong

With that you could do this if you always want to keep the extension
ren %1 "%NewName%.*"


Thread locked

Messages in this Thread

94,967 Postings in 11,969 Threads, 349 registered users, 23 users online (1 registered, 22 guests)
Index | Admin contact |   Forum Time: May 25, 2020 - 7:16 pm EDT  |  Hits:31,229,743  (6,090 Today )
RSS Feed