Commands & Syntax > Commands > Folder Manipulation >

www.perfectkeyboard.com

 

RENAME - < dirrename >() ... [Pro]

 

Folder RENAME
<dirrename>("Folder","New name",Unused,Unused)
Available in: Professional edition

Renames directory specified.

 

#

Parameter name

Parameter description

1

Folder

(Full) path to the source directory (e.g., "c:\mydocuments").

2

New name

New name of the directory (for example, "mydocuments_old").

3

Unused

Must be 0.

4

Unused

Must be 0.

 

Example (Macro Steps):

 

1

<#> <#> This macro renames directory you select.

2

Macro execution: ONLY COMMANDS

3

Message SHOW "" : "Select folder you want to rename." (other parameters: x = 100, y = 100, Window title = Message, Buttons = None, Timeout (seconds) = , Always on top = ).

4

Variable OPERATION "SELECT_FOLDER" (Variable for result = vDirSource, Input text/variable = , Parameter 1 = Select Source Folder, Parameter 2 = , Parameter 3 = 0)

5

Procedure CALL: ExitOnCancel with parameters ()

6

Message CLOSE

7

Folder RENAME vDirSource, New name = RENAMED,Unused = 0

8

<#> <#> --------------------------------------------------------------------

9

Procedure BEGIN: ExitOnCancel with parameters ()

10

IF STRING _vCanceled==1

11

Macro EXIT

12

ENDIF

13

Procedure END

14

<#> <#> --------------------------------------------------------------------

Example (Plain Text):

 

<#> This macro renames directory you select.

<#>

<cmds>

 

<msg>(100,100,"Select folder you want to rename.","Message",0)

<var_oper>(vDirSource,"",SELECT_FOLDER,"Select Source Folder","", "0")

<proc_call>(ExitOnCancel,)

<msgoff>

 

<dirrename>("vDirSource","RENAMED",0,0)

 

<#> --------------------------------------------------------------------

 

<proc_def_begin>(ExitOnCancel,)

<if_str>("_vCanceled==1")

   <exitmacro>

<endif>

<proc_def_end>

 

<#> --------------------------------------------------------------------