SOLVED!
Uses drag & drop and windows shell's context menu's "open with" to write an exe wrapped vbsfile with path of the target that then opens an elevated task to defeat UAC per program - appears to be the only option capable of getting commandline arguments to work while defeating UAC.
OK - this is a multistepped issue I have overcome! (for personal use) - LOL
First I noticed that during the UAC lockscreen the commandline had 2 switches inserted before the original WScript.Arguments and it was breaking programs ability to "drag&drop" onto [exefile] or use "Open with" from context menu because the WScript.Arguments(0) was now WScript.Arguments(2).
I was able to over come this by registry entry:
**Registry Entry**
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\FolderName\\ProgramName.exe"="~RUNASADMIN"
After doing the above the UAC entries no longer showed up on the commandline for either the context menu or drag&drop!
Now I was unable to keep the commandline arguments after making the UAC stop no matter if I used TaskScheduler or the 3rd party UAC Trust Shortcut since there was no way to add a %variable% or a "%1" with any of these programs only accepting static commandlines.
I was able to get a [vbsfile] to use drag&drop and parse all the WScript.Arguments then write that result into another [vbsfile] parsing the commandline that I could then open with Task Scheduler to a static filename then avoiding the dreaded UAC Prompt!
**VBSfile to use as drag&drop target**
Set fso=CreateObject("Scripting.FileSystemObject")
Set objFile = fso.CreateTextFile("C:\FolderName\VBStoParseCommandline.vbs" , True)
If WScript.Arguments.Count=0 Then
hhh=""
Else
hhh=WScript.Arguments(0)
If Ucase(fso.GetExtensionName(hhh)) = "LNK" Then
set Ws = CreateObject("WScript.Shell")
set Lnk = Ws.Createshortcut(hhh)
hhh=Lnk.TargetPath
End If
End If
objFile.WriteLine("CreateObject(""Wscript.Shell"").Run ""C:\FolderName\VBStoParseCommandline.vbs """"" & hhh & """"""" , 1, False")
CreateObject("Wscript.Shell").Run "SCHTASKS /Run /TN ""VBStoParseCommandline"""
Not only will this create another [vbsfile] but it will also trigger the Task Scheduler that will then open the new VBScript to open the original program with no UAC prompt!
Here is an example of the [vbsfile] that the drag&drop target file will write:
**called by the Task Scheduler**
CreateObject("Wscript.Shell").Run "C:\FolderName\OriginalProgramName.exe ""C:\FolderName\CommandlineArgumentIwasTryingToGet.png""" , 1, False
From here I had it all working with drag&drop from a shortcut [lnkfile] with a changed icon [icofile] but was unable to use the [vbsfile] with the context menu's "Open with" as the windows shell blocked it...
I was able to get a script wrapper named ScriptCryptor that behaves exactly as the [vbsfile] did but is now wrapped in an [exefile]. I was even able to wrap the icon from the original program and place it in the same location as ProgramNameNoUAC.exe avoiding the need for a shortcut and allowing all shell support.
Now I can Pin to Start as well as Pin to Taskbar and use context menu's "Open with" and have no UAC Prompt on a per program basis...
Given you now can cut and paste this to your project it can be a minute or less to repeat for another program...
image of folder view with added files and "Open with" from context menu