My User Profile has a space in it (firstname – space – lastname) and because of that, when I installed some program, it created a file in my C:\Users directory with only my first name. I don’t know how or when this happened.
Now when I use “Run” and type %temp%, Windows gives me the error that it cannot find “C:\User(firstname)”.
Is there some way I can restore the value to the original?
Delete or rename the errant directory.
On Windows, several services try to be “smart” in how they handle commands if there are spaces in the filename. The algorithm starts by splitting the input by spaces (as with normal command-line parsing), then collecting neighbouring arguments if the first component doesn’t give a valid path. If it finds a valid path at some point, it stops parsing and treats the rest as arguments.
Say I have
C:\Users\John Smithand an errant directoryC:\Users\John. Then, if I try to access%TEMP%, Windows expands it toC:\Users\John Smith\AppData\Local\Temp. Since the first ‘argument’C:\Users\Johnexists, it is treated as a command, but since it isn’t a command (it’s a file), you get that error.