Search code examples
setup-projectnsis

Rename a directory during installation with the REN command


I decided that the easiest way to rename the directory is through the REN command in windows with Exec. However, it just doesn't work. The program runs successfully, but doesn't do anything. Below is a basically what I'm trying to do.

OutFile "test.exe"
Section
Exec 'REN "C:\Rename me" "Done"'
SectionEnd

and by the way

REN "C:\Rename me" "Done" 

works fine in cmd. I also tried RENAME with the same results. Any idea what I'm doing wrong?


Solution

  • Ren is a internal command inside cmd.exe, you would have to execute cmd.exe /c ren foo bar but NSIS has a Rename instruction, why not use that?