diff --git a/deploy/installer/cleanup/installscript.qs b/deploy/installer/cleanup/installscript.qs
index dbbedee0..27260233 100644
--- a/deploy/installer/cleanup/installscript.qs
+++ b/deploy/installer/cleanup/installscript.qs
@@ -14,9 +14,10 @@ Component.prototype.createOperations = function()
              * Cleanup AppData and registry
              */
             component.addElevatedOperation("Execute","echo do nothing","UNDOEXECUTE","cmd /C reg delete HKEY_CURRENT_USER\Software\nheko\nheko /f");
-            if( installer.environmentVariable("LOCALAPPDATA") != "" )
+            var localappdata = installer.environmentVariable("LOCALAPPDATA");
+            if( localappdata != "" )
             {
-                component.addElevatedOperation("Execute","echo do nothing","UNDOEXECUTE","cmd /C rmdir %LOCALAPPDATA%\nheko /f");
+                component.addElevatedOperation("Execute","echo do nothing","UNDOEXECUTE","cmd /C rmdir "+localappdata+"\nheko /f");
             }
         }
     }
diff --git a/deploy/installer/gui/installscript.qs b/deploy/installer/gui/installscript.qs
index 0a75f6b7..e007c42c 100644
--- a/deploy/installer/gui/installscript.qs
+++ b/deploy/installer/gui/installscript.qs
@@ -35,8 +35,8 @@ Component.prototype.createOperations = function()
                 var localappdata = installer.environmentVariable("LOCALAPPDATA");
                 if( localappdata != "" )
                 {
-                    var command = "cmd /C rmdir " localappdata+"\nheko /f";
-                    component.addElevatedOperation("Execute","echo do nothing","UNDOEXECUTE",command);
+
+                    component.addElevatedOperation("Execute","echo do nothing","UNDOEXECUTE","cmd /C rmdir "+localappdata+"\nheko /f");
                 }
             }
         }