"Using hdparm in limited user accounts" or "starting progs with adminrights before waking up from hi

P

PatrickMail

Hi everybody,

I am using the programm hdparm to modify the settings of my HDD
(especially Advanced Power Management). This program works fine, but
has to be executed in each session. This is no problem, because it can
simply be but into a batch file and placed in the start-up folder.

However, I frequently use limited user accounts. Here, the command
does not work. It terminates with "hda: Permission denied". Is there
an option to let windows execute the command before I log into the
limited user account and thus to keep the option set while I work in
that account? I also have to mention that I usually use the hibernate
function, so actually, there is no real start-up process.

The situation is the following: When I am looged in as an admin and
start hdparm and then change into a limited account everything is fine
and the HDD option is set. When I then put the computer into
hibernation and then wake it up again next morning the setting is gone
and I have to switch to an admin account to make hdparm set the option
again.

Does anybody of you have an idea how I could solve this problem?

Greetings.
 
P

Pegasus \(MVP\)

Hi everybody,

I am using the programm hdparm to modify the settings of my HDD
(especially Advanced Power Management). This program works fine, but
has to be executed in each session. This is no problem, because it can
simply be but into a batch file and placed in the start-up folder.

However, I frequently use limited user accounts. Here, the command
does not work. It terminates with "hda: Permission denied". Is there
an option to let windows execute the command before I log into the
limited user account and thus to keep the option set while I work in
that account? I also have to mention that I usually use the hibernate
function, so actually, there is no real start-up process.

The situation is the following: When I am looged in as an admin and
start hdparm and then change into a limited account everything is fine
and the HDD option is set. When I then put the computer into
hibernation and then wake it up again next morning the setting is gone
and I have to switch to an admin account to make hdparm set the option
again.

Does anybody of you have an idea how I could solve this problem?

Greetings.

Since this program affects the system, not the user session, you should
execute the command as part of your startup process. It would be
sufficient to schedule your batch file to run at boot time. Don't invoke
it as part of the logon process.

When returning from hibernation then you could use Hibernate Trigger
to invoke your batch file again:
http://www.desimonesystems.com/suspendtrigger/index.php
I haven't tried it myself - this is an educated guess.
 
P

PatrickBrzoskaPB

Hi, when I use Hibernate Trigger programs are not executed with admin
rights. It is just like starting the batch myself by clicking when
returning from hibernation to my limited account.
 
P

Pegasus \(MVP\)

Hi, when I use Hibernate Trigger programs are not executed with admin
rights. It is just like starting the batch myself by clicking when
returning from hibernation to my limited account.

You could get Hibernat Trigger to create a semaphore file which
gets picked up by a task scheduled to run every five minutes. Not
particularly elegant but effective . . .
 
P

PatrickBrzoskaPB

Semaphore file? What's this? And how will it overcome the limited
rights on a LUA?
 
P

Pegasus \(MVP\)

Semaphore file? What's this? And how will it overcome the limited
rights on a LUA?

Simple:
1. You get Hibernate Trigger to create the file c:\semaphore.txt
(for example) when the machine wakes up.
2. A scheduled task running once every five minutes under
an account with admin privileges checks for the presence
of c:\semaphore.txt. When it finds it then it does two things:
a) It deletes c:\semaphore.txt.
b) It runs hdparm.exe.
As I said, not elegant but effective.
 
P

PatrickBrzoskaPB

But this way the admin account needs to run in the background
(slowing down the systems).
In case it runs anywhy, hdparm could also be started normally (via the
startup or via scheduled tasks "run at log-on") or am I wrong?
 
P

Pegasus \(MVP\)

If you can measure a slow-down effect of a scheduled task that executes
the command

if not exist c:\semaphore.txt goto :eof

then I would love to hear how you achieve this amazing feat.

I covered the startup sequence in my previous reply - please have
another look at it.

But this way the admin account needs to run in the background
(slowing down the systems).
In case it runs anywhy, hdparm could also be started normally (via the
startup or via scheduled tasks "run at log-on") or am I wrong?
 
P

PatrickBrzoskaPB

Hi, I found another solution for my problem.

I simply run the program using the command "runas /user:USERNAME
"Progname.exe". Works fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top