Skip to content
⌘ NSIS Forum Archive

Rename a file in the $WINDIR

5 posts

Antichrist77#

Rename a file in the $WINDIR

Hi,

i have a fuc*ing probelm with NSIS! I want to rename the notepad.exe to notepad2.exe but my script don't work because the compiler says: "$WINDIR" is a unkown variable??? In the docs I have read that "$WINDIR is the windows directory (usually C:\windows or C:\winnt but detected at runtime)". Please write a example script! Not just one parse.

Thx
Afrow UK#
You must be using it in your script wrongly, because if $WINDIR was and unknown variable and you used it in a dir path, it wouldn't matter anyway.

Should be:
Rename "$WINDIR\notepad.exe" "$WINDIR\notepad2.exe"

-Stu
Brummelchen#
be concious that WinXP repairs missing files on renaming/deleting or moving them

>> I want to rename the notepad.exe to notepad2.exe

W2k too i think

you first have to delete (better replace) notepad.exe in the program cache ($sysdir\dllcache) - then do your action.
Antichrist77#
@Afrow UK

Hi 😉,

big thx to you! I have forget the " " 🙂 thats why it don't work... Now it works perfectly!


Cu
Antichrist