Hi Alice-7236,
You need to run the batch file with administrator rights.
Follow the steps mentioned below.
- Right-click on your batch file.
- Click Create Shortcut
- Right-click on the shortcut files and click on Properties.
- In the Shortcuts tab, click on Advanced.
- Check the ‘Run as Administrator’ checkbox.
- Click OK to close the dialogue box.
- Click on Apply to save the changes. Click Ok to close Properties.
Now, every time you run the shortcut file by double-clicking it, the Windows UAC message will be displayed. Click Ok to run as administrator in Windows. This is required as commands would need access to more system-level components that are not available when you open CMD in user mode.
I hope this answers your question.
Thanks.
--If the reply is helpful, please Upvote and Accept as answer--