This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9920|Reply: 1

BAT scripts use the administrator run to switch to the current directory

[Copy link]
Posted on 2020-12-16 14:19:26 | | | |
BAT scripts use the administrator run to switch to the current directory

When you directly double-click to run a bat script, the script command can be executed from the current directory, and some operations can be performed normally.

However, when running a bat script as an administrator, the run directory is:C:\Windows\system32

Solution:

Using the variable enrichment method, read out the directory of the current file, and then cd past:







Previous:.NET Core、. NET Standard, ASP.NET Core, and .NET Framework relationships
Next:ASP.NET Core (ServiceAdmin) enables online management of Windows services
 Landlord| Posted on 2020-12-16 14:33:22 |
Knowledge about other variable augmentation:


Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com