I have different users that have name with space and no space : John Doe, Jane Susy I tried typing %APPDATA% in command prompt, and all i get is John / Jane.
How should i script my batch/cmd file, so it supports folder with spaces?
Copy /y %APPDATA%\Folder\Templates\abc.txt %APPDATA%\Folder\Templates\FoldABC >nul
when i use echo %AppData% i get the full name John Doe / Jane Susy. When i just type %AppData% , i get John / Jane
I am trying to do the following:
if exist %APPDATA%\Folder\Templates\abc.txt (
Copy /y %APPDATA%\Folder\Templates\abc.txt %APPDATA%\Folder\Templates\FoldABC >nul
)
Here is the error i get :
if exist C:\Users\John Doe\AppData\Roaming\Microsoft\Templates\abc.txt(
'Doe\AppData\Roaming\Folder\Templates\abc.txt' is not recognized as an internal or external command, operable program or batch file.
echo %AppData%return? If double quotes doesn't work, try%UserProfile%\AppData\Roaming, otherwise you could echo the%UserName%within the path, but that shouldn't be necessary