I made a batch for windows to install some programs and make settings automatically, it worked normally, but when doing a test using a folder that had space in its name it stopped working, put it in the variable "" and returned to normal .
But I want to avoid any future problems and I made a folder with some characters that can give a problem, the folder name looks like this:
New - action folder '; # @ $% ¬ & () + -., {}] [~~~~
This is my last test:
SET mypath="%~dp0"
cd %mypath%
If I opened the cmd by accessing the folder as administrator or with normal user it works normally, but if I use the explore clico twice it works with the normal user but not as administrator, so it opens as administrator the script closes immediately. p>
My script should run as administrator so this has become a problem, of course this problem only occurs in this folder with the full name of special characters.
How to run a script without worrying about special characters?
I've recorded a video for you to see what's going on.