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.

John

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
pause


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

Ben

161 views      
 

Messages in this Thread

 
94,644 Postings in 11,937 Threads, 348 registered users, 13 users online (0 registered, 13 guests)
Index | Admin contact |   Forum Time: Dec 9, 2019 - 10:13 am EST  |  Hits:29,382,356  (1,191 Today )
RSS Feed