Windows 8 batch files
Moderator: DosItHelp
Windows 8 batch files
I am new to writing Batch files. I have Windows 8. I am In the middle of writing a Batch file that changes my password. I just tried what I have. I tried to run It as Administrator and the program just open and close. If I just run the script It works but saids access denied so I know I need to run It as Administrator. Can you Help me? I am new here so I don't know If I can post the Batch file I am tring to write?
Re: Windows 8 batch files
Yes, post your batch script here.
The problem is that running as Administrator changes the working directory to c:\windows\system32
You can put this at the start of your batch file to keep the working directory the same as where the batch file is:
The problem is that running as Administrator changes the working directory to c:\windows\system32
You can put this at the start of your batch file to keep the working directory the same as where the batch file is:
Code: Select all
@echo off
cd /d "%~dp0"
:: and put your code below here
-
- Posts: 233
- Joined: 21 Nov 2010 08:07
- Location: At My Computer
Re: Windows 8 batch files
you can also add a runas admin script at the beginning as well.