Replacing text in shortcut.xml reverts to original version
-
Problem: Replacing text in the C:\appsensevirtual… \shortcut.xml file causes shortcut.xml file to revert back to original install version.
Things tried:
- Searching this forum for solution (Apologize in advance if keyword search was error)
- Used regular notepad (not notepad++) to replace text in shortcut.xml file. (Txt ok as other users were successful).
- Rebooted computer prior to opening Notepad++ to see if macros updated.
- Reinstalled notepad++
Notepad++ v8.4.6 (64-bit)
Build time : Sep 25 2022 - 19:51:39
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : “C:\appsensevirtual\S-1-5-21-588371583-1805265460-4214133073-8206682{2D2AB830-0C50-487C-92A7-85A414C81931}\Signed_B_NotePad++\Device\HarddiskVolume3\Users<myusername>\AppData\Roaming\Notepad++\shortcuts.xml”
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 21H2
OS Build : 19044.3324
Current ANSI codepage : 1252
Plugins :
ComparePlugin (2.0.2)
JSMinNPP (1.2202)
mimeTools (2.8)
NppConverter (4.4)
NppExport (0.4)
NPPJSONViewer (1.40)
XMLTools (3.1.1.12) -
@Eric said in Replacing text in shortcut.xml reverts to original version:
Used regular notepad (not notepad++) to replace text in shortcut.xml file
Was Notepad++ running when you tried to edit the shortcut.xml? if so, then when Notepad++ closed, it overwrote whatever changes you made.
https://npp-user-manual.org/docs/config-files/#editing-configuration-files describes a known-working procedure for editing Notepad++ configuration files.
-
No. As mentioned in Notepad++ documentation and other posts, I made sure all instances of Notepad++ were closed and edit to shortcut.xml performed with Notepad to take Notepad++ out of the equation. After saving in Notepad, I closed out Notepad. Rebooted and then opened up Notepad++.
I had other instances where this issue occurred but rebooting “seemed” to be the solution but alas.
-
@Eric
I noted the commandline in the first post shows “C:\appssensevirtual…”. A quick check on the Web shows this to be a product called AppSense by Ivanti. It’s a virtual user/desktop infrastructure. Is that what you are working in?So we now have Windows thinking it’s doing stuff and behind the scenes another product is “messing” with the environment. I’d be willing to bet AppSense is playing a part in this.
Since the shortcuts.xml file is located in a hidden folder (that’s the %AppData% normally used to access this folder) in a users profile it makes sense to consider this is a location that Windows (and possibly AppSense) prefers users don’t mess with (too much). Generally changes here are made by the application itself. In this instance you have used Notepad to edit the “configuration” of another product. Is AppSense intelligent enough to determine this and perhaps revert the changes?
A way of exploring this would be to follow the process of editing the shortcut.xml file from within Notepad++, much as the online manual (link as shown in previous post) suggests is a good method.
Terry
-
Thanks for reply Terry. You are correct about AppSense by Ivanti and updating the shortcut.xml file within %AppData% (eg. hidden file).
I can try the edit within Notepad++ again; however, prior attempts as documented in referenced online manual still caused the shortcut.xml file to revert back to install version. Thus, the switch to using original Notepad which appeared to be successful by some but not all.
One curious thing that I noted when others had similar issue. They were able to make the change but did not accurately copy/paste text into shortcut.xml file. They attempted to correct but then the file would revert back to the inaccurate version and not the install version of shortcut.xml. When software replaces a file, is there a certain time frame and/or number of attempts allowed before software will not allow edits and revert back to last saved version?
Any rate, success has been random and unable to find method that confidently succeeds.
-
@Eric said in Replacing text in shortcut.xml reverts to original version:
Any rate, success has been random and unable to find method that confidently succeeds
I think with all the information you have now provided it does seem evident that AppSense is causing all these issues. I can’t explain why it doesn’t happen every time, and nor should I attempt to as that is outside what this forum is about.
So if you accept that you may never get past this issue using your current methodology it just remains to consider another path. There are actually several ideas I will put to you. Maybe one of them will work for your environment.
1> If you have access to “behind the scenes” with AppSense you may be able to find out how to get AppSense to not interfere with Notepad++ configuration files. So you will either be an IT support person, or be on good friendly terms with one of your IT support people. This may not work well long term as any type of update/change to AppSense may well negate what you have achieved.
2> Using some of Notepad++ options to consider other locations of the configuration files. The first one is the ability to use an alternate location for these files. See this section of the online manual. The part including
“-settingsDir=“d:\your settings dir”: Override the default settings dir”
and
here with
“There is a command-line option -settingsDir which will set a new directory for the per-user configuration file location.”Search order: If the -settingsDir option is set, that configuration file directory will take priority over any other configuration file directory. If the Cloud directory setting is defined and enabled, that will take priority over the portable or standard configuration file directory. If doLocalConf.xml is present, the portable configuration file location will take priority over the %AppData%\Notepad++\ directory. If none of the other configuration file directories are active, then the standard configuration file directory is %AppData%\Notepad++. If it cannot find a configuration file in any of the per-user locations, it will use the version from the same directory as the executable.
3> The Portable version of Notepad++
here with
"By default, the installer will use %AppData%\Notepad++ to store your settings; but when you use the installer to install to a directory other than “Program Files”, you can choose the installation option “Don’t use %APPDATA%” to instead use a “local configuration”.’OR
Install Notepad++ from 7z or zip
These instructions will allow you to run a portable or mini-portable (also called “minimalist”), without requiring administrative privileges."Good luck but at this point I think we have helped as best we can. I truly believe this isn’t a Notepad++ issue. Maybe there is an AppSense forum where you can continue your quest to find an answer if you elect to try option #1.
Terry
-
I agree Terry. Thanks for your thoughtful response and time.
My system environment is well locked down including what/how things can be downloaded/installed. I think option #2 may be best bet. Some noted when replacing text within the shortcut.xml file to allow time for file to save versus save and instantly close out of the shortcut.xml file. Anecdotal and not vetted but may be something within virtual environment.
I consider thread closed unless someone has definitive solution. Thanks again.