Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Antonio Bakula
2 discussion posts
Hi !

I tried to stop windows service from scripted function and it has no rights to do so, when opening service exception Access is denied. That is no suprise becouse this code should be run elevated. So only way I can think to do that is to run service stop code in separate application, is there a way to do it trough Display fusion.

here is the exception logged:

2017/01/15 23:26:42.665##_##FAIL:L1##_##displayfusionsettings.exe:2832##_##BFScriptCode:Run##_##-##_##Exception has been thrown by the target of an invocation. • Cannot open ymc service on computer '.'. • Access is denied##_##-
Jan 15, 2017  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You could do the following, but it will throw a UAC prompt:

Code

using System;
using System.Drawing;
using System.Diagnostics;

public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
ProcessStartInfo startInfo = new ProcessStartInfo ("C:\\windows\\system32\\cmd.exe", "/c net stop DisplayFusionService");
startInfo.Verb = "runas";
Process.Start (startInfo);
}
}


There's no way to do it without the UAC prompt as far as I know, unless you run DisplayFusion as Administrator.

Hope that helps!
Jan 16, 2017 (modified Jan 16, 2017)  • #2
User Image
Antonio Bakula
2 discussion posts
Thanks Keith, I didn't remember cmd line option, that is simplest solution
Jan 18, 2017  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
No worries, glad I could help!
Jan 18, 2017  • #4
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)