error 0x80070002 error 2: The System cannot find the file specified

Windows 7 Home Premium, Service Pack 1, Intel Core 2 *** Email address is removed for privacy ***, 64 bit, Product ID: 00359-OEM-etc.

This problem is similar to many others, but I cannot find an exact answer. 

It started many months back with intermittent problems with the Ethernet/ Network connection to the DSL modem.  Possibly a problem with RASPPPOE file, which was never correctly resolved, maybe a virus or malware, or a blue screen shutdown, or a registry 'repair' that did more damage by cleaning. 

The real problem started when the printer would not function.  The Print Spooler Service would not run.  Set to 'Automatic', the service would not start due to error 2: The System cannot find the file specified.  The path for this service was '%SystemRoot%\system32\spoolsv.exe.  After much troubleshooting, I was able to start the service by going into the registry to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Spooler and I changed the ImagePath from %SystemRoot%\system32\spoolsv.exe to C:\windows\system32\spoolsv.exe.  This change allowed me to 'start' the Print Spooler Service and the printer is back up and working. 

Similarly, I found that all of the services that have as their 'Path to executable': %SystemRoot%\system32 were not started and would not start.  These include Volume Shadow Copy, Remote Procedure Call, Security Accounts Manager, and many others.  I went through the ones that are set to "Automatic' and changed their ImagePath in regedit from %SystemRoot% to C:\windows.  The problem is that so much of the registry points to %SystemRoot%, but it doesn't seem to know where that is. 

The System Path in Control Panel- System and Security- System Properties- Advanced- Environment Variables- System variables is C:\Windows;C;\Windows\system32;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\etc.  The error 0x80070002 occurred when I attempted to do a restore from an image.  I don't think I want to do that anyway as I might loose everything and at this point all of the important things are running.  Can anyone explain how this registry cannot find %SystemRoot% and how I might be able to correct this problem?

Answer
Answer
The %SystemRoot% variable is a system variable that is set automatically by Windows. If it is missing on your machine then something has damaged your registry. What it is I do not know.

Instead of manually correcting the countless %SystemRoot% instances, you could create just one value in this registry location: HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. This is where most environmental variables are defined. Just make it the same way as OS or Temp. Whether it will work I do not know. Adding a value to the registry won't hurt but modifying or deleting existing values can do harm.

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated March 12, 2023 Views 2,551 Applies to: