I was trying to update the path environment variable for my Windows 8.1 PC using the setx command from a command prompt (I won't be making that mistake again), which a) didn't work, and b) truncated the path user environment variable to 1024 characters; now, the final entry in the environment variable is not a valid path (it cuts off part way through a folder name), and an unknown number of entries have been deleted (I checked in advanced system settings and the path system environment variable appears to still be in tact).

My question is: how can I recover the state of the path user environment variable before it was truncated? I have tried following several answers, including using 'process explorer' (I believe this is no longer an option, because I have been forced to log off since the truncation occurred, and so all of the programs that were open at the time are now closed) and 'registry editor', but following these instructions didn't seem to work (for example, trying to follow this answer did not work, because in step 4, on my PC there was no "little button to the right of "Open" for "Show Previous Versions"", so I could no longer follow those instructions).

So if someone could explain step-by-step how to view a previous version of the path user environment variable that would be great.

(Note that I don't have any terminal windows open from before the truncation happened, so I can't just use echo %path% in command prompt, and in Windows 8.1, Microsoft appears to have disabled the ability to view previous versions of things, although admittedly I don't fully understand to what extent).

1 Answer 1


I realize this is an OLD post, but it didn't have an answer, and I happened upon an answer. I ran into this same issue after following some bad instructions on redhat about installing OpenJDK

There's a file in C:\System Volume Information\SPP\OnlineMetadataCache that's hidden, and system. You'll have to enable view of protected system files, and add yourself to the permissions list to several directories on the way down. However, if you use a strings application on the file stored here, you'll hopefully get a fairly recent copy of your path statement. The file will be named something like: {xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}_OnDiskSnapshotProp

Hope this helps someone down the line, I know it did me! And dang it windows 10, why would you not update your setx to handle more than 1024 characters or ask permission before truncating something?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .