There are multiple ways to do something in NSIS, while one of them is most efficient and one works best.
CopyFiles /SILENT "Path\to\file.txt" "Path\to\new\folder"
CopyFiles /SILENT "Path\to\file.txt" "Path\to\new\folder" Delete "Path\to\file.txt"
(Use when moving between drives)
Rename "Path\to\file.txt" "Path\to\new\folder\file.txt"
(For quick moving)
Delete "Folder\file.txt" Delete "Folder\file.txt" and so on... RMDIR "Folder" or RMDIR /r "Folder"
${registry::KeyExists} "HKEY_CURRENT_USER\Software\ExampleBackupByExamplePortable" $R0
StrCmp $R0 "0" RestoreSettings
${registry::KeyExists} "HKEY_CURRENT_USER\Software\Example" $R0
StrCmp $R0 "-1" RestoreSettings
${registry::MoveKey} "HKEY_CURRENT_USER\Software\Example" "HKEY_CURRENT_USER\Software\ExampleBackupByExamplePortable" $R0
Sleep 100
RestoreSettings:
IfFileExists "$SETTINGSDIRECTORY\Example.reg" "" LaunchNow
;RestoreTheKey:
IfFileExists "$WINDIR\system32\reg.exe" "" RestoreTheKey9x
nsExec::ExecToStack `"$WINDIR\system32\reg.exe" import "$SETTINGSDIRECTORY\Example.reg"`
Pop $R0
StrCmp $R0 '0' LaunchNow ;successfully restored key
RestoreTheKey9x:
${registry::RestoreKey} "$SETTINGSDIRECTORY\Example.reg" $R0
StrCmp $R0 '0' LaunchNow ;successfully restored key
StrCpy $FAILEDTORESTOREKEY "true"
;DoneRunning:
StrCmp $FAILEDTORESTOREKEY "true" SetOriginalKeyBack
${registry::SaveKey} "HKEY_CURRENT_USER\Software\Example" "$SETTINGSDIRECTORY\Example.reg" "" $0
Sleep 100
${registry::DeleteKey} "HKEY_CURRENT_USER\Software\Example" $R0
Sleep 100
${registry::KeyExists} "HKEY_CURRENT_USER\Software\ExampleBackupByExamplePortable" $R0
StrCmp $R0 "-1" TheEnd
${registry::MoveKey} "HKEY_CURRENT_USER\Software\ExampleBackupByExamplePortable" "HKEY_CURRENT_USER\Example" $R0
Sleep 100
StrCmp $DISABLESPLASHSCREEN "true" GetPassedParameters
;=== Show the splash screen before processing the files
InitPluginsDir
File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
newadvsplash::show /NOUNLOAD 1500 200 0 -1 /L $PLUGINSDIR\splash.jpg