New 7.9.3 (x64 standard e portable) It will not start

  • The installation 7.9.3 apparently seems to complete positively (even if it does not appear selected, then the chosen language in translation …) while at the next start, both in Windows 7 x64 and in windows 10 20h2.804 (operating OS and VM clean) via start menu and / or link does not start me.
    Equally with the .zip version as well as .7z portable.
    Excuse my English (as a translator) LOL

  • @Claudio-Reniè

    Do you have installed the NppSaveAsAdmin plugin? Npp v7.9.3 crashes at startup if this plugin is installed. I already filed an issue in the plugin’s repo.

  • Ok I confirm that was the problem (it was enough to delete this plugin from the ./plugin/ folder. Thanks.

    However, I understand that until the “Save as Admin” plugin is updated there is no possibility to save as Administrator …?

  • @Claudio-Reniè

    one option would be to run npp as administrator, but that raises other issues, such as not being able to drag and drop files from unprivileged other processes.

  • ok. thank you all

  • Same problem here, and same solution too. :)
    Thanks for the tip.

  • @Claudio-Reniè , @ChelOis

    There is, as there usually is, a possible workaround as long as you are willing to install a scripting plugin, in this case the NppExec plugin.

    1. Install the NppExec plugin using PluginsAdmin.
    2. After Notepad++ has restarted, paste the following code to a new document:
    Option Explicit
    'Constants declaration
    Const SW_HIDE = 0
    'Variables declaration
    Dim colArgs, objFSO
    Dim strSrcFilePath, strDstFilePath
    'Create basic objects
    Set colArgs = WScript.Arguments
    Set objFSO  = CreateObject("Scripting.FileSystemObject")
    'Not enough arguments => exit
    If colArgs.Count < 2 Then WScript.Quit 1
    'Retrieve source and destination file path from arguments
    strSrcFilePath = colArgs(0)
    strDstFilePath = colArgs(1)
    'Exit if
    '  - source and destination file are equal
    '  - source file doesn't exist
    '  - destination file's folder doesn't exist
    If StrComp(strSrcFilePath, strDstFilePath, vbTextCompare) = 0 Then WScript.Quit 0
    If Not objFSO.FileExists(strSrcFilePath) Then WScript.Quit 2
    If Not objFSO.FolderExists(objFSO.GetParentFolderName(strDstFilePath)) Then WScript.Quit 3
    'Script doesn't run with admin rights => Restart elevated
    If Not IsElevated Then
      Call RestartElevated(SW_HIDE, Array(strSrcFilePath, strDstFilePath))
    End If
    'Destination file already exists => delete it
    If objFSO.FileExists(strDstFilePath) Then
      Call objFSO.DeleteFile(strDstFilePath)
    End If
    'Move source file to destination
    Call objFSO.MoveFile(strSrcFilePath, strDstFilePath)
    ' Check if script runs with elevated user rights
    Function IsElevated()
      Dim objWshShell, strKey
      Set objWshShell = CreateObject("WScript.Shell")
      On Error Resume Next
      strKey = objWshShell.RegRead("HKEY_USERS\S-1-5-19\Environment\TEMP")
      IsElevated = (Err.Number = 0)
    End Function
    ' Restart script with elevated user rights
    Sub RestartElevated(ByVal intShowState, ByRef arrParams)
      Dim objFSO, arrArguments(), intCnt
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      ReDim arrArguments(UBound(arrParams) + 2)
      arrArguments(0) = "/nologo"
      arrArguments(1) = WScript.ScriptFullName
      For intCnt = 2 To UBound(arrArguments)
        arrArguments(intCnt) = arrParams(intCnt - 2)
      Call RunElevated(WScript.FullName, objFSO.GetParentFolderName(WScript.ScriptFullName), intShowState, arrArguments)
      WScript.Quit 0
    End Sub
    Sub RunElevated(ByRef strCommand, ByRef strWorkFolder, ByVal intShowState, ByRef arrParams)
      Dim objShell
      Dim intCnt, strArguments
      Set objShell = CreateObject("Shell.Application")
      strArguments = ""
      For intCnt = 0 To UBound(arrParams)
        strArguments = strArguments & " " & Quote(arrParams(intCnt))
      objShell.ShellExecute strCommand, strArguments, strWorkFolder, "runas", intShowState
    End Sub
    ' Surround a string with double quotes
    Function Quote(ByRef strString)
      Quote = """" & strString & """"
    End Function
    1. Save the document as SaveAsAdmin.vbs to a folder where you have write permissions.
    2. In Windows Explorer, navigate to <Npp-directory>\plugins\NppExec and create a new directory SaveAsAdmin. Move the file saved in step 3. to this directory (Admin permissions required). If you prefer another location or name for this file, you have to change the script below accordingly.
    3. In Notepad++, go to (menu) Plugins -> NppExec -> Execute... and paste the following code to the dialog popping up:
    npp_console keep
    set local $(CurFilePath) = $(FULL_CURRENT_PATH)
    npe_console -- v+
    cmd.exe /c "@echo %RANDOM%"
    set local $(TempFilePath) = $(SYS.TEMP)\NppSAA_TempFile_$(OUTPUT1)_$(FILE_NAME)
    npe_console -- v-
    npp_saveas "$(TempFilePath)"
    cscript.exe /nologo "$(NPP_DIRECTORY)\plugins\NppExec\SaveAsAdmin\SaveAsAdmin.vbs" "$(TempFilePath)" "$(CurFilePath)"
    sleep 200
    npp_open "$(CurFilePath)"
    1. In the combobox at the lower left enter SaveAsAdmin and click the Save button.
    2. Go to (menu) Plugins -> NppExec -> Advanced Options.... Use the UI at the left hand side of the dialog to create a menu entry in Npp’s Macro menu for the script you saved in step 6.
    3. Click OK button and restart Notepad++.
    4. Go to (menu) Settings -> Shortcut Mapper... -> (register) Plugin commands and define a keyboard shortcut for the menu entry you created in step 7.

    When you want to save a file that needs admin permissions to be written, press the configured keyboard shortcut and confirm the UAC dialog popping up.

    Small flaw: The file has to be closed and reopened with Notepad++, thus its tab will be the rightmost one in tabbar.

  • @dinkumoil

    Thank you so much, it works like a charm.

  • @dinkumoil

    WOW… Apparently it seems complicated to me but I’ll try … thanks again and let you know

    Lengthy quote including source code removed

  • @Claudio-Reniè

    Meanwhile another user at GitHub figured out that plugin version 1.0.172 still works, thus you can also use this old version (have a look at Releases section of the plugin repo). AFAIK it lacks support for elevating Save as... user interaction.

  • I wanted to point out that here the new version compatible with notepad ++ 7.9.3 has been released (without the reported error).


Log in to reply