Batch File - C:\Users\%username%

I am trying to create a Batch file that will go to this path - C:\Users\%username%

It seems that the path doesn't want to work on Windows 7. Can someone explain why?
 
Are there spaces in the username? (Ex: Users\John Smith)

If so, you need to put the path in quotes (which you should do anyway) so it would be "C:\Users\John Smith\"
 
Can I see your batch file? I ran a couple quick tests and cd "C:\Users\%username%" has worked as I expect it to. I tried cd "C:\Users\%username%", cd "C:\Users\%username%\", cd "C:\Program Files" and cd "C:\Program Files\" (just to get a path with a space in it)
 
Back
Top