Search found 15436 matches

by jvierra
Fri Jun 30, 2023 10:37 am
Forum: PowerShell
Topic: Unable to create Reg Key
Replies: 14
Views: 4569

Re: Unable to create Reg Key

HKEY_USERS is not the current user account hive it is a collection of all hives for all loaded accounts. How do you know which profile is the current user? There are usually a minimum of 5 hives loaded. Again everything you are asking for can be more easily done with Tasks. Services can work but are...
by jvierra
Thu Jun 29, 2023 7:09 pm
Forum: PowerShell
Topic: Unable to create Reg Key
Replies: 14
Views: 4569

Re: Unable to create Reg Key

Clearly you need to leqarn about tasks. Tasks are created globally and work on user accounts at login and at other key times. The task cannot alter anything a user has no access to so sometimes we have to alter the permissions on a user key value. This can be done once and globally. A user should ne...
by jvierra
Thu Jun 29, 2023 6:54 pm
Forum: PowerShell GUIs
Topic: Button Click in ForEach Creation
Replies: 8
Views: 1874

Re: Button Click in ForEach Creation

You do not need to create variables. The step number is the button name.

Maybe you should slow down and take some time to learn Windows objects, events, and how forms a re intended dto be coded. This is actually much easier than you think.
by jvierra
Thu Jun 29, 2023 4:49 pm
Forum: PowerShell
Topic: Unable to create Reg Key
Replies: 14
Views: 4569

Re: Unable to create Reg Key

All of that can be done writing any code using Tasks.
To work outside of simple GUI apps it is necessary to learn Windows at a technical level. Services should be your last choice and hopefully, never chosen.
by jvierra
Thu Jun 29, 2023 11:44 am
Forum: PowerShell
Topic: Unable to create Reg Key
Replies: 14
Views: 4569

Re: Unable to create Reg Key

If the user is kicking of the task, isn't it still being run by the user? Still won't have permissions to update the reg key The whole point of using a service is to eliminate the user. There is no user to "kick off" anything. The logged on users sessions do not exist in the scope of the ...
by jvierra
Thu Jun 29, 2023 1:53 am
Forum: PowerShell GUIs
Topic: Button Click in ForEach Creation
Replies: 8
Views: 1874

Re: Button Click in ForEach Creation

In the future you can find details on how to use Forms and Controls here: https://info.sapien.com/
by jvierra
Thu Jun 29, 2023 1:49 am
Forum: PowerShell GUIs
Topic: Button Click in ForEach Creation
Replies: 8
Views: 1874

Re: Button Click in ForEach Creation

I can't understand what you are asking so here is another possibility.

$exeButton.add_Click(
# add button code here
)
by jvierra
Thu Jun 29, 2023 1:46 am
Forum: PowerShell GUIs
Topic: Button Click in ForEach Creation
Replies: 8
Views: 1874

Re: Button Click in ForEach Creation

The button object for the current event can be addressed with the "$this" dynamic variable. It is always the object that sent the event. Of course you code is not tied to anything so it is hard to know what you are doing. Normally we do these things in the "ButtonClick" event and...
by jvierra
Wed Jun 28, 2023 5:43 pm
Forum: PowerShell
Topic: Unable to create Reg Key
Replies: 14
Views: 4569

Re: Unable to create Reg Key

You are creating the key under HKCU. that is the account that is running the service and not the account you are logged on as.

This is why we use Scheduled Tasks to do this type of thing. It is safer, easier and targets the correct accounts.