Batch file questions

July 30, 2009 at 14:56:20
Specs: Windows Vista Home Basic SP1
relevant system info: windows vista home basic sp1

What I want to do may be too much for batch files and may need something more powerful.

What I am attempting to do:
When a specific user is logged in have one screen resolution, and when the user is logged off or switched to change to another resolution.

additionally when the user is loaded when it has already been logged in to run the .bat.

now i have found an app that works to change the screen resolution in a bat file qres (
and I have made 3 .bat files
one that changes my resolution on startup.
two to change my resolution and log me off
and three to change my resolution and take me to the usr lock screen. (shortcut= %windir%\System32\rundll32.exe user32.dll,LockWorkStation)

i think this can be simplified.

question one:
the lock screen is ok... but i want it to go to the usr log in screen. i have no tsdiscon.exe
and when i got one and put it in the system32 folder it wasnt compatible with the system. is there another way to do this?

question two:
is there a way to run a .bat on usr logon not usr startup. ie... then loading my programs and settings that were running when i switched a usr to also run a .bat.

question three:
is there a way to run a script when switching users as well as when logging off?

thanks in advance for the help!
all posts welcome...

See More: Batch file questions

Report •

July 30, 2009 at 16:36:40
If you want something more powerful than batch files for Vista, download powershell. It's free from MS & you can do a lot more scripting with it.

How do you know when a politician is lying? His mouth is moving.

Report •

July 30, 2009 at 19:50:01
Thank you for the reply.

powershell is a much more powerful scripting tool. but i dont see how this has answered any of my questions. I have spent the last few hours reading the documentation, and manuals... And unless I am missing something this is not what I need.

I am attempting to have as little user interaction in this process as possible and what I have works it requires the user to run a script to log off or switch users... and another script when loging that user again (assuming that the user didnt log out)

Report •

July 31, 2009 at 04:55:45
I think you would have a better chance of getting all the scripts you want in a programming forum, particularly one where VB is discussed.

How do you know when a politician is lying? His mouth is moving.

Report •

Related Solutions

July 31, 2009 at 09:20:26
Thank yo again for the reply.

the .bat files that i have made work. With the exception of the one to take me to the switch user screen. That is not the issue.

Maybe I was not very clear. And I have been thinking of what I want and I may have a better way to ask the question.

What file is called to bring up user settings? such as desktop.ini ect... and can this run a .bat?

I dont think a programing forum is what is needed. I dont think a program running in the background while the user is logged in is the answer. I could be wrong, But I think there is a better answer.

I hope it can be answered here... If not thanks for the help.

Report •

July 31, 2009 at 10:48:44
As far as I know the file that holds the user settings is either user.dat or ntuser.dat

The system runs a .bat file at a time you specify & exits on completion. The same goes for a vb script. Some people prefer a vb script, which is why I mentioned it. No matter what, it's all based on programming or scripting.

There is a scripting forum at

I think you'll get a better answer there.

How do you know when a politician is lying? His mouth is moving.

Report •

August 23, 2009 at 05:13:47
As you can see it has been weeks. I have tried to fnd my own answer elsewhere. And I'm still where I was so thanks anyway.

Report •

Ask Question