Everything Else

If you must use Windows 10 and default apps is driving you crazy... - Page 2

VenomousPinecone wrote:
Shiunbird wrote: The official suggestion from IT Security Management is to open a powerpoint presentation, start a slide slow, run whatever I need to run and lock my screen.

You should post that up to his LinkedIn and see if his "colleagues" agree.


The worst thing is that I found out the bad way (trying to leave something running overnight) that it doesn't work.
So what I did was... we use a tech support platform called Bomgar. If you are using Bomgar to fix someone's computer, you get admin access to the command prompt.

So I use that to launch PowerShell, and then disable hibernation. But it only lasts until Group Policies are pushed again... :|
Image Image
Could you create a scheduled task (with admin rights) to keep re-applying the change every minute perhaps?
Systems in use:
:Indigo2IMP: - Nitrogen : R10000 195MHz CPU, 384MB RAM, SolidIMPACT Graphics, 36GB 15k HDD & 300GB 10k HDD, 100Mb/s NIC, New/quiet fans, IRIX 6.5.22
:Fuel: - Lithium : R14000 600MHz CPU, 4GB RAM, V10 Graphics, 72GB 15k HDD & 300GB 10k HDD, 1Gb/s NIC, New/quiet fans, IRIX 6.5.30
Other system in storage: :O2: R5000 200MHz, 224MB RAM, 72GB 15k HDD, PSU fan mod, IRIX 6.5.30
Trippynet wrote: Could you create a scheduled task (with admin rights) to keep re-applying the change every minute perhaps?


I think I can create a scheduled task using powershell logged in through the remote support tool. I'll try and report back.

In the meantime, I submitted a request to commission a Linux VM so I can run what I need to run there. They will give me 48 hours root access, so I need to install all I need and then hope standard users can use cron.
Image Image
Can you compile anything in C#?

If so.. Create a project with a form
Add a timer - 'timerSetKey' in my example.
Add a label - no real need to do this, mine is called 'labelResponse' but it's add some feed back.
Throw this in the form .cs file

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;


namespace StopScreenSaver
{
public partial class FormStopScreenSaver : Form
{
public static int iCount=0;
[FlagsAttribute]
public enum EXECUTION_STATE : uint
{
ES_SYSTEM_REQUIRED = 0x00000001,
ES_DISPLAY_REQUIRED = 0x00000002,
// Legacy flag, should not be used.
// ES_USER_PRESENT   = 0x00000004,
ES_AWAYMODE_REQUIRED = 0x00000040,
ES_CONTINUOUS = 0x80000000,
}

public static class SleepUtil
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
}

public void PreventSleep()
{
if (SleepUtil.SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS
| EXECUTION_STATE.ES_DISPLAY_REQUIRED
| EXECUTION_STATE.ES_SYSTEM_REQUIRED
| EXECUTION_STATE.ES_AWAYMODE_REQUIRED) == 0) //Away mode for Windows >= Vista
SleepUtil.SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS
| EXECUTION_STATE.ES_DISPLAY_REQUIRED
| EXECUTION_STATE.ES_SYSTEM_REQUIRED); //Windows < Vista, forget away mode
}
public static int iKeyPressed =0;
public FormStopScreenSaver()
{
InitializeComponent();
timerSetKey.Enabled = true;
}

private void timerSetKey_Tick(object sender, EventArgs e)
{
labelResponse.Text = string.Format("Count {0}",iCount.ToString());
labelResponse.Update();
PreventSleep();
iCount++;
}
}
}

StopScreenSaver is the name of my form.
Don't forget to set the timer to an interval relating to a second, set the tick event and ensure it is enabled by default else you will have to do it on form load or when the form initializes.
Add some nice Icons, and colours and away you go. Tested, proved and stolen!
Must admit I haven't tested it running as non admin, but I don't see an issue.

PM me if you want the project sent to you.
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------
I can compile C#. I'll give it a shot!
Image Image