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%.*"



Messages in this Thread

94,727 Postings in 11,942 Threads, 348 registered users, 19 users online (0 registered, 19 guests)
Index | Admin contact |   Forum Time: Jan 28, 2020 - 1:31 am EST  |  Hits:29,804,089  (1,385 Today )
RSS Feed