Hello,
I've created a scheduled task within PatchMyPC and modified it to run on user logon. However the application will just sit there not updating or doing anything. Running PatchMyPC.exe /silent works fine from cmd. I tried running patchmypc.exe /silent manually using a command prompt running under the user SYSTEM and this is the error returned.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.DirectoryNotFoundException: Could not find special directory 'Desktop'.
at Microsoft.VisualBasic.FileIO.SpecialDirectories.GetDirectoryPath(String Directory, String DirectoryNameResID)
at PatchMyPC.PMPC.CheckCustomDownloadPath()
at PatchMyPC.PMPC.patch_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2110.0 built by: NET47REL1LAST
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
PatchMyPC
Assembly Version: 3.2.0.1
Win32 Version: 3.2.0.1
CodeBase: file:///C:/Users/Tom/Downloads/PatchMyPC.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.7.2046.0 built by: NET47REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2110.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2102.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2110.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2046.0 built by: NET47REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2046.0 built by: NET47REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2102.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2114.0 built by: NET47REL1LAST
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Clicking on continue will then load the gui but wont do any patching.
Thanks for reporting this. Do you have a custom download path enable in the options?
I have experienced the same thing recently whilst testing scheduled tasks on our network and found it to be related to incomplete registry keys within the HKLM\Software\Patch My PC\Options key. I initially received the error whilst running in silent or auto mode as SYSTEM user (scheduled task configured to run even when a user is not logged on). From my investigations, it seems to relate to the PortableAppPath value which defaults to the environment variable for the current users Desktop and therefore doesn't exist when running as SYSTEM. If you run the task as a real user first, it sets the path in the registry and then run again as SYSTEM it works. Alternatively, if you are running PMPC from a script instead of a standard task, you should set the PortableAppPath to a generic path such as C:\PortableApps.
Hope this helps.
I actually still get a similar error when running PMPC as SYSTEM with the switch /applyallcommon
Running with the same switch as a normal admin user doesn't present the same error.
Failed To read Or write To the registry permission denied. Error: could not find special directory 'Desktop'.
We will be looking into this issue for the next update.
Just checking to see if this issue is still being worked on. I have come to realize that the scheduled task (even when using the suggested schedule) is not updating anything. It appears to launch an instance of Patch My PC, but it never actually does anything.
I created a "Patch My PC" folder in Program Files (x86) to store the exe and .settings files. I used the Save Suggested Schedule button. Tested it on multiple machines with the same results.
What OS are you running?
I've seen it happening on Windows 10 version 1709 and 1703. When the scheduled task runs, I see the process for PMP but it doesn't install or patch the applications. If I run the same command interactively it works without issue. It only does this when scheduled to run as the system account.
/applyallcommon is no longer supported. If you want to install specific apps, please use the DefaultApps configuration file documented here: https://patchmypc.net/faq-free-updater
Quote from: kitley on September 25, 2017, 10:55:03 AM
I actually still get a similar error when running PMPC as SYSTEM with the switch /applyallcommon
Running with the same switch as a normal admin user doesn't present the same error.
Failed To read Or write To the registry permission denied. Error: could not find special directory 'Desktop'.
We should have this fixed in the next update later this week.