Author Topic: Send to Set Always Run As Admin no longer working  (Read 14616 times)

0 Members and 1 Guest are viewing this topic.

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Send to Set Always Run As Admin no longer working
« on: April 29, 2015, 11:54:31 pm »
I don't know how this happened. Was working a few weeks ago. Now I just get a blank cmd window. Including a short video showing what's happening. I even removed ALL context menu tweaks in case they were interfering. Also, ran the AIO repair tool.  Somewhere I borked something!  https://youtu.be/PGqZ-cSfvrk

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #1 on: May 01, 2015, 09:58:00 am »
Go to the bat file itself and check it, right click and hit edit and make sure nothing has changed it.

Shane

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #2 on: May 01, 2015, 10:46:47 am »
Redownloaded it just in case, but here is the contents:
Quote
@echo off
setlocal enableDelayedExpansion
:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::

:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************

setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
ECHO UAC.ShellExecute "!batchPath!", "%*", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B

:gotPrivileges
::::::::::::::::::::::::::::
:START
::::::::::::::::::::::::::::

@echo off
setlocal ENABLEDELAYEDEXPANSION
rem Take the cmd-line, remove all until the first parameter
set "params=!cmdcmdline:~0,-1!"
set "params=!params:*" =!"
set count=0

rem Split the parameters on spaces but respect the quotes
for %%G IN (!params!) do (
  set /a count+=1
  set "item_!count!=%%~G"
  rem echo !count! %%~G
)

rem list the parameters
for /L %%n in (1,1,!count!) DO (
set "strexe=!item_%%n!"
set "strexe=!strexe:~-3!"

IF /I ["!strexe!"] EQU ["exe"] reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags" /f
IF /I ["!strexe!"] EQU ["exe"] reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /f
IF /I ["!strexe!"] EQU ["exe"] reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "!item_%%n!" /t REG_SZ /d "RUNASADMIN" /f

IF /I ["!strexe!"] EQU [".ex"] reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags" /f
IF /I ["!strexe!"] EQU [".ex"] reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /f
IF /I ["!strexe!"] EQU [".ex"] reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "!item_%%n!e" /t REG_SZ /d "RUNASADMIN" /f

)

exit

I ran into this with windows 8.1 before, but this time I'm in Windows 7 Pro. It was working about a month ago. I've no idea what could be affecting it. Thanks, Shane.

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #3 on: May 04, 2015, 01:57:39 pm »
What the bat file does is make a script file and runs it to see if it gets a result, forcing the UAC to ask for permissions, onces it has permissions it then takes the file you dropped onto it and adds it to the registry.

So from the looks of it, it might be that the UAC isnt getting triggered so the bat file isnt getting permission to write to the registry. Have you tried having the bat file set to always run as administrator?

Shane

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #4 on: May 04, 2015, 02:48:53 pm »
Hi, ironically that option is grayed out I'm afraid. All other bat files on my computer have it grayed out at well. I'm going to try to add it manually to the registry. Will report back. BTW do place it in
Quote
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
or
Quote
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

Added it to both, still not working.  :confused:
« Last Edit: May 04, 2015, 03:06:42 pm by madhouserevival »

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #5 on: May 04, 2015, 04:26:27 pm »
Very odd, I dont know off the top of my head and it would be best if I could take a look at it, I just dont have time right now to do it though. :wink:

Shane

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #6 on: May 04, 2015, 05:42:02 pm »
I understand. Ran the AIO repair again, also included Repair Reparse Points and Environmental Variables. Also checked off "Inlcude .Cat Files" box (no idea what it's for). BTW I clicked  the Create a System Restore Point but it didn't work though I can do it the normal way in Windows, so I think something got borked in that setting.

Guess somewhere someone has run into the same issue with a particular cmd file though Google now omits tons of results for queries that I know for a fact exist but now produce no results. Suck it, Google!  :angry:

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #7 on: May 10, 2015, 09:29:33 pm »
Well, I did a fresh install of Windows 8.1 Pro. Added it to my send to folder. Getting this error now LOL

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #8 on: May 11, 2015, 07:42:45 pm »
When that comes up, go to that path and grab that vbs file so I can take a look at it :wink:

Shane

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #9 on: May 11, 2015, 10:21:33 pm »
Here you go. Win 8.1 is being crazier than I remembered. For one thing it won't let me verify my identity (button does nothing) nor switch to a local account. If it wasn't so much faster than Win 7....  :rolleyes:

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #10 on: May 12, 2015, 01:44:05 am »
Well I see the problem

""E:\Downloads\Disk Utilities\Defraggers\smart-defrag 4-setup.exe""

It is putting double quotes. Which isnt proper and so we get the error. For some reason when the file name is being sent to the bat file there is quotes already with it and so the bat file is adding them already and so now we have double.

The trick would be for me to update the bat file to see if there is already quotes or not :-)

Shane

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #11 on: May 12, 2015, 02:37:13 am »
Replace the bat file with this one, see if it does better :-)

Shane

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #12 on: May 12, 2015, 09:18:34 pm »
Getting a blank cmd window. This thing worked fine last month now it doesn't work even on a new install of Windows? I am cursed.  :evil: Even tried turning off DEP. Including a DXDIAG file just in case. Thanks for your time, Shane. It's tedious, I know.
« Last Edit: May 12, 2015, 09:22:32 pm by madhouserevival »

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #13 on: May 12, 2015, 09:27:21 pm »
The old bat file does still work, I just dragged and dropped an exe right over it, but when I did a shortcut it added the double quotes. So in this new batch file I tested it and got it to not do that. Very odd.

Shane

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #14 on: May 12, 2015, 10:46:21 pm »
I have the same OS (Win 8.1 Pro) installed on a regular hard drive on this same system. It runs fine on that one even though it's been tweaked, over-loaded with software and isn't up to date:  but doesn't work in in this fresh up to date version installed on my SSD. So I'm including the DXDIAG from the Win 8.1 Pro it DOES work in.  Maybe you can compare it to the other one I uploaded on my last post and spot something fundamentally different, even though they're the same OS.  In your own time, of course. Don't mean to hog your attention.  :shy:

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #15 on: May 14, 2015, 01:43:45 pm »
DirectX has to do with gaming and 3d graphics and all that, nothing to do with the bat file or how it is handled :-)

The problem is that for some reason explorer is sending the path name with quotes already on it, and then the bat file is adding them again making it not work.

While it would be easy to simply have the bat file not add them it would also keep it from working for when there isnt any quotes. So the new bat file i made was an attempt at simply handing those extra quotes, at least that is what was giving you the script error, if you are not getting the script error then something else is going on. You could try having the bat file set to always run as administrator.

Shane

Offline madhouserevival

  • Full Member
  • ***
  • Join Date: Dec 2013
  • Posts: 105
  • Karma: 2
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #16 on: May 18, 2015, 06:42:29 pm »
Well, apparently if I installed Windows 8 with my linked account the darn thing wouldn't work because apparently MS's synch settings had some flaw (reinstalled 5 times!). So I reinstalled again but created a whole new account and it's working in Windows 8 now. But with the same configuration of hardware and "tweaks" in Windows 7 Pro it just gives me that blank cmd window LOL.  :tongue: :undecided: :shocked: :rolleyes: :omg:

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Send to Set Always Run As Admin no longer working
« Reply #17 on: May 19, 2015, 12:14:24 pm »
When I have some more free time it will be better for me to connect to you and look at it myself and get it working :-)

Shane