Windows Path Variables
-
I have a confusing issue with Windows Path Variables. I have a script - that had been working - but is now not. Troubleshooting the issue has left me perplexed.
My original script was:
robocopy "%userprofile%\AppData\Local\Google\Chrome\User Data\Default" "d:\_folder-it\Chrome-Default" /xa:sh /xjd /r:5 /w:5 /tee /np
However, it errors with;
2022/02/11 11:08:45 ERROR 3 (0x00000003) Accessing Source Directory C:\Users\MYUserName\%LOCALAPPDATA%\Google\Chrome\User Data\Default\ The system cannot find the path specified.
I've been using the common variables so it doesn't make much sense...
Am I just missing something really simple?
-
@gjacobse said in Windows Path Variables:
I have a confusing issue with Windows Path Variables. I have a script - that had been working - but is now not. Troubleshooting the issue has left me perplexed.
My original script was:
robocopy "%userprofile%\AppData\Local\Google\Chrome\User Data\Default" "d:\_folder-it\Chrome-Default" /xa:sh /xjd /r:5 /w:5 /tee /np
However, it errors with;
2022/02/11 11:08:45 ERROR 3 (0x00000003) Accessing Source Directory C:\Users\MYUserName\%LOCALAPPDATA%\Google\Chrome\User Data\Default\ The system cannot find the path specified.
I've been using the common variables so it doesn't make much sense...
Am I just missing something really simple?
Probably a permission and account issue. For instance what user or system account is robocopy running under?
Always try it by changing things such as instead of running
robocopy
do adir
of the directory and save it to a file or something similar. You'll find the problem by testing and excluding. -
@pete-s said in Windows Path Variables:
Probably a permission and account issue
Well - SH___T
Seems that I managed to be in an Admin CMD window rather than my normal CMD window. Obviously that will cause issues since that would be cross accounts.
I seriously need a day off from IT.... all of IT.
Locking topic - as I don't need more hashing
-