bat files only work if 'Run as Admin', will not work otherwise


Recommended Posts

I have a few programs that rely on .bat files to operate, but for some reason in Windows 10, I can not run the file(s) without right clicking - Run as Admin before executing the file. None of the commands that are being called require admin privileges, and work just fine outside of the batch file. I have also tried changing the extension from .bat to .cmd to see if it corrects the issue, and it does not.
Here is what happens when I execute the file without admin:
bat_problems.thumb.PNG.484ef9fb713d5a2ab

  Does anybody happen to have any idea as to what is going on? Just as a matter of testing: My roommates system is running the same version of Win10 and he does not have the issue that I am having.

  On 11/10/2015 at 19:12, xendrome said:

Try using "runas /user:administrator C:\data\mybatchfile.bat"

I'll try that, but the other problem is that the bat file is basically created and called from another program, the program spits back an error, but I'm able to run the file that it creates.

Edit:
Just tried using the command, it still does not work by itself, but will if I right click run as admin

 

I'll give it a try, I would like to know what the underlining cause is, and why it works on my roommates system. Is this a windows error or is it an NTFS security issue?

Are you running an unmodified profile or did you turn off something? Same with roomies profile, default or modified? 

UAC disabled? 

Normal account or admin account? Yours and roomies. 

Does your room mate get the parent application running by right clicking, then selecting run as admin

Are you running the parent program as an administrator but not right clicking and selecting run as admin

Run As admin gives a user that has an administrative account elevated privileges. There is a hidden admin account with elevated privileges, higher than a user account that has administrative access.

  On 12/10/2015 at 17:40, akwe-xavante said:

Does your room mate get the parent application running by right clicking, then selecting run as admin

Are you running the parent program as an administrator but not right clicking and selecting run as admin

Run As admin gives a user that has an administrative account elevated privileges. There is a hidden admin account with elevated privileges, higher than a user account that has administrative access.

No and no.
This has worked before in windows 10, but after doing a reinstall (upgraded to SSD) it has not worked.

Your bat file is on Drive E: or is it?

An Operating system is usually installed on Drive C:

Is the parent program looking on the wrong drive for the file?

Is the bat file located on a mapped drive, USB stick or external hard drive or a partition on the SSD drive.

Has the drive letter of the drive where your bat file is changed?

 

Yes it's on E:, so is the parent program. It is a physical drive, not a network or USB.
Here is a sample of what it looks like, note I did not create this, the program I use as a GUI for LAME creates this file each time.
go.thumb.PNG.6966504146a29493f2a131415c2

  On 12/10/2015 at 23:53, jnelsoninjax said:

This has worked before in windows 10, but after doing a reinstall (upgraded to SSD) it has not worked.

i remember seeing similar line before, oh yeah here it is:

  Quote

If you're using Windows system and you lost an access to your files or folders (for example, after system reinstallation), use NTFS Access to regain it. The program sets permissions recursively, so you don't have to repeat the process for each file or folder separately.

 http://www.zeus-software.com/downloads/ntfsaccess

  On 13/10/2015 at 01:39, zhangm said:

In cmd check the output (I guess it shouldn't differ between accounts):

 

echo %comspec%

d:\windows temp\ only because C is an SSD, so I have all the temp on a physical disk

  On 13/10/2015 at 02:03, jnelsoninjax said:

d:\windows temp\ only because C is an SSD, so I have all the temp on a physical disk

 

That's not the temp path variable. Edit it to point to cmd.exe (full path) and try your batch again.

  On 13/10/2015 at 02:05, zhangm said:

 

That's not the temp path variable. Edit it to point to cmd.exe (full path) and try your batch again.

Still says the same thing :/

This topic is now closed to further replies.