Is there any way to replace a space in %username% with an underscore. Within cmd.
For example:
Username: john doe
Actual Folder path for %username%: john_doe
NET USE Z: \\server\folder\%username%\ /P:Yes
Is there any way to replace a space in %username% with an underscore. Within cmd.
For example:
Username: john doe
Actual Folder path for %username%: john_doe
NET USE Z: \\server\folder\%username%\ /P:Yes
set "newusername=%username: =_%"
creates a new variable with the space replaced.