Re: Run my exe as admin without prompt?
Posted: Mon Dec 31, 2018 4:29 am
"process" should appear once in the command.
Can you try the same command with notepad.exe?
Can you try the same command with notepad.exe?
http://www.purebasic.com
https://www.purebasic.fr/english/
Yes, that double "process" was a typo that you made.skywalk wrote:"process" should appear once in the command.
Can you try the same command with notepad.exe?
Code: Select all
wmic /node:localhost /user:Admin /password:*** process call create "C:\Windows\Notepad.exe"
Because you're running it under a different user account (your "admin-user") with highest privileges and the logged in user has no access to it's gui...The scheduled task gets created, and my exe is (apparently) run with admin rights at logon, but it seems to run "silently" in that no window is displayed, it doesn't respond to its hotkeys, its system tray icon doesn't appear
Code: Select all
RunAtLogin(taskname$,exe$,elevated=0)
So I did that, and now the exe doesn't run with admin rights under a limited account, which is the whole idea.forumuser wrote:Code: Select all
RunAtLogin(taskname$,exe$,elevated=0)
Here. I changed the computer name, userid and exe details for my privacy.forumuser wrote:Export the task and show the full .xml content!
Code: Select all
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2018-12-31T19:16:44</Date>
<Author>Computer Name\Admin</Author>
<URI>\Product Name</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<StartBoundary>2018-12-31T19:16:00</StartBoundary>
<Enabled>true</Enabled>
</LogonTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-21-2569149087-587176876-3879654987-1203</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>false</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>false</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\Path\To\MyApp.exe</Command>
</Exec>
</Actions>
</Task>
My tip. As a reasonable provider of an app, you would advise your customers to do without these magic games to save themselves a few clicks. Microsoft didn't introduce the security guidelines for fun.Dude wrote:Thanks for any advice.
So you're saying it's better that the customer works out how to do that themself, instead of my app providing a way to do it for them? Sounds logical, actually. Would solve a lot of hassle that I'm going through.Josh wrote:As a reasonable provider of an app, you would advise your customers to do without these magic games to save themselves a few clicks.
You mean stop editing my posts? I was just doing that to clarify things, but I will stop in future. I didn't realise it was a problem. Sorry!Josh wrote:Please refrain from changing your entry threads all the time.