Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Why can I no longer run a program as administrator!?

20 Dec 2019   #1
Marty McFly

Windows 7 Home Premium 64bit
 
 
Why can I no longer run a program as administrator!?

Many years ago I downloaded a handy .bat file which automatically creates firewall entries. I've always had it set up to run as administrator, as this is required.

But today I tried to run the file and it won't run as administrator!? In the Properties > Compatibility, the option to "Run as administrator" is greyed out. This is not the case with other programs, just this /bat file.

Could this have something to do with the fact that I recently installed a critical Windows update (kb4012212)?


My System SpecsSystem Spec
.
21 Dec 2019   #2
samuria

win 8 32 bit
 
 

Try renaming it to . CMD
My System SpecsSystem Spec
21 Dec 2019   #3
Marty McFly

Windows 7 Home Premium 64bit
 
 

Quote   Quote: Originally Posted by samuria View Post
Try renaming it to . CMD
Thanks, but that didn't work.
My System SpecsSystem Spec
.

4 Weeks Ago   #4
FreeBooter

Windows 10 Pro x64
 
 

Add the below code beginning of batch script to run it with administrative privileges.



Code:
net sess>nul 2>&1||(powershell start cmd -ArgumentList """/c %~0""" -verb Runas & exit)
My System SpecsSystem Spec
4 Weeks Ago   #5
Marty McFly

Windows 7 Home Premium 64bit
 
 

Quote   Quote: Originally Posted by FreeBooter View Post
Add the below code beginning of batch script to run it with administrative privileges.
Thanks but that didn't work, the DOS prompt just opens then disappears when I add that to the start of it.
My System SpecsSystem Spec
4 Weeks Ago   #6
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

Hi Marty McFly,

Quote   Quote: Originally Posted by Marty McFly View Post
Thanks but that didn't work, the DOS prompt just opens then disappears when I add that to the start of it.
That needs to be ADDED to the beginning of the Batch File. Then save the Batch File with the .bat extension and then run it!
My System SpecsSystem Spec
4 Weeks Ago   #7
FreeBooter

Windows 10 Pro x64
 
 

Below is a example batch script.


Code:
:: Disable Downloaded Files from being Blocked in Windows
 @echo Off


net sess>nul 2>&1||(powershell start cmd -ArgumentList """/c %~0""" -verb Runas & exit)

call :IsAdmin


:_Start
Cls & Mode CON  LINES=11 COLS=100 & Color 0E 
Echo.
Echo.       
Echo         Type (D) letter to  Disable Downloaded Files from being Blocked for All Users  
Echo.       
Echo.
Echo.
Echo.         
Echo         Type (E) letter to Enable Downloaded Files from being Blocked for All Users   
Echo.         



Set /p input= RESPONSE: 
If /i  Not %input%==D (Goto :_Ex) Else (Goto :_Disable)

:_Ex
If /i  Not %input%==E  (Goto :_Start) Else (Goto :_Enable)





:_Disable

Reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v "SaveZoneInformation" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v "SaveZoneInformation" /t REG_DWORD /d "1" /f

Exit



:_Enable

Reg.exe delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v "SaveZoneInformation" /f
Reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v "SaveZoneInformation" /f




:IsAdmin
Reg.exe query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
 Cls & Echo You must have administrator rights to continue ... 
 Pause & Exit
)
Cls
goto:eof
My System SpecsSystem Spec
.
Reply

 Why can I no longer run a program as administrator!?




Thread Tools




Similar help and support threads
Thread Forum
Hacker chasing me - I'm no longer recognized as administrator
Hi! I guess there must be one hacker who has really been chasing me a lot lately. I've had to use my set of restore disks several times this month, already! This last time, I downloaded Microsoft Security Essentials. But today, I'm not allowed to use it or any other files - with the error...
System Security
A program will no longer run
It is Adobe's Lightroom (a photo-enhancement program). It installed it lasy July and it worked fine many times until I went to use it a few days ago. It launches but immediately produces an error message:" Lightroom encountered an error when reading from its preview." "Lightroom will attermpt to...
Software
I can't run any program as Administrator
Hello, I recently dealt with a minor malware issue, uninstalled and cleared out Google Chrome of some "isurf" or sth similar which was on my Chrome a start page. The issue I have now is I can't run anything as administrator... I cannot get into My Computer/Manage to get into regedit, Command...
General Discussion
Can no longer run batch files unless as administrator
Windows 7 64-bit Home Premium - Dell 660 w/i5 Intel - 8GB RAM I've been running the same batch files for several years with the same login account. Now, all of a sudden, I have to run them as administrator. My personal account already is an 'administrator' and not a standard user account. ...
General Discussion
Run program as administrator
Just ran across another way of doing this. I'll list common way and "new" way using CMD as example. This works if you are logged in under an administrator account. Elevated command prompt = Run CMD.EXE as administrator WIN key Type CMD.EXE (do not hit Enter key) ...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 18:41.
Twitter Facebook