+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
Windows Thread, Auto log off user after a program is closed in Technical; turn off screensavers?...
  1. #16

    Join Date
    Feb 2009
    Posts
    460
    Thank Post
    66
    Thanked 34 Times in 21 Posts
    Blog Entries
    1
    Rep Power
    19
    turn off screensavers?

  2. #17

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,271
    Thank Post
    884
    Thanked 2,749 Times in 2,322 Posts
    Blog Entries
    11
    Rep Power
    785
    If you want to edit the reg after the change you can simple load up the user.dat reg file from the game users profile in regedit and change it from within the administrator account.

  3. #18
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    252
    Thank Post
    86
    Thanked 8 Times in 6 Posts
    Rep Power
    16
    Quote Originally Posted by SYNACK View Post
    If you want to edit the reg after the change you can simple load up the user.dat reg file from the game users profile in regedit and change it from within the administrator account.
    Awesome. Never done that attempt before, I'll give that a shot, thanks!

    And ya I ended up disabling the screensaver on that account or setting the value to 1 in regedit if I want to do maintenance. So at the moment it's 1, then I'll hide it again later when the consoles actually ready.

    Thanks guys! I'll let you know how it goes. Next steps are to install the games, make sure the logging on and logging off work seamlessly with the game start and quit, and then test imaging.

  4. #19
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    252
    Thank Post
    86
    Thanked 8 Times in 6 Posts
    Rep Power
    16
    Hmm, I'd really like to use the User Shell idea, but I think VB may be what I have to go with.

    I set the game as the user shell and the game doesn't run, and gives the error "could not initialize graphics system. make sure that your video card and driver are compatible with directdraw". As soon as I CTRL+ALT+DEL and run Explorer, select the game from the start menu, it launches fine. Must be dependant on something in explorer...unless I'm missing something.

    Also, after that error, it doesn't log me back out. Maybe I have to quit the game properly to log out, but at the moment since I'm getting the error I have to CTRL+ALT+DEL and choose log out from the task manager Shut Down menu.

    Any suggestions?

    If not I'll try VB next. Thanks!

    ::EDIT::

    Just tried with Starcraft, same thing. They both give errors related to being unable to change video settings when they're set as User Shell. As soon as you start up Explorer.exe and then launch the game, it works perfectly. Starcrafts specific error has lots of information on changing screen resolution etc. or updating DirectX, which isn't what we need of course. But it lists the specific error if that helps.

    The error encountered while trying to switch video modes was:
    Not implemented
    vidinimo_PC.cpp line 160
    SetDisplayMode

    Sounds like it's calling for something required in explorer? No idea really. About to try VB. Let me know if you have any ideas for the user shell! That would be my preference if possible since it's near tamper proof for the average user. Thanks so much.

    ::EDIT::

    VB error on line 3 char 1. Argument not optional: 'oShell.run' Code 800A01C1
    Last edited by link470; 12th April 2009 at 01:52 AM.

  5. #20
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    252
    Thank Post
    86
    Thanked 8 Times in 6 Posts
    Rep Power
    16
    Hey guys! I haven't found anything else yet that would do a better job than what you all have suggested. Anything ideas on fixing the user shell error or the VB script, or any other ideas? I've still got 2 weeks.

    Thanks!

  6. #21

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,271
    Thank Post
    884
    Thanked 2,749 Times in 2,322 Posts
    Blog Entries
    11
    Rep Power
    785
    What is the full VBS code that you are having issues with?

    It looks like lots of the stuff is implemented through explorer now which was not the case back in win 98 which was the last time that I used this type of method. The other option would be to try a cut down shell replacement set to start the program, possibly one of there: [ame=http://en.wikipedia.org/wiki/Windows_shell_replacement]Windows shell replacement - Wikipedia, the free encyclopedia[/ame]

  7. #22
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    252
    Thank Post
    86
    Thanked 8 Times in 6 Posts
    Rep Power
    16
    Quote Originally Posted by SYNACK View Post
    What is the full VBS code that you are having issues with?
    I was using the VB script mentioned earlier on the first page of this thread.

    Quote Originally Posted by srochford View Post
    VBS would be:
    Code:
    set oShell=createobject("wscript.shell")
    sCmd="C:\Games\Starcraft.exe"
    oShell.run,,true 'true forces it to wait for process to finish
    Set OpSystems = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
    
    for each OpSys in OpSystems
    	OpSys.Win32Shutdown 0
    next
    the WMI stuff to log off is a bit of overkill - you could just do:
    Code:
    sCmd="shutdown /l"
    oShell.run sCmd
    you then run this with "wscript <name of vbscriptfile>" (you want wscript otherwise a cscript window will lurk in the background)
    So that's what I did, and this is the exact code I have that generates that error:

    Code:
    set oShell=createobject("wscript.shell")
    sCmd="C:\Program Files\Microsoft Games\Age of Empires II\EMPIRES2.EXE"
    oShell.run,,true 'true forces it to wait for process to finish
    Set OpSystems = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
    
    for each OpSys in OpSystems
    	OpSys.Win32Shutdown 0
    next
    sCmd="shutdown /l"
    oShell.run sCmd

  8. #23

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,271
    Thank Post
    884
    Thanked 2,749 Times in 2,322 Posts
    Blog Entries
    11
    Rep Power
    785
    Quote Originally Posted by link470 View Post
    I was using the VB script mentioned earlier on the first page of this thread.


    So that's what I did, and this is the exact code I have that generates that error:
    Your missing a few bits in the code and have some extra, try this:
    Code:
    set oShell=createobject("wscript.shell")
    sCmd="C:\Program Files\Microsoft Games\Age of Empires II\EMPIRES2.EXE"
    oShell.run sCmd,1,true 'true forces it to wait for process to finish
    sCmd="shutdown /l"
    oShell.run sCmd

  9. #24
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    252
    Thank Post
    86
    Thanked 8 Times in 6 Posts
    Rep Power
    16
    Quote Originally Posted by SYNACK View Post
    Your missing a few bits in the code and have some extra, try this:
    Code:
    set oShell=createobject("wscript.shell")
    sCmd="C:\Program Files\Microsoft Games\Age of Empires II\EMPIRES2.EXE"
    oShell.run sCmd,1,true 'true forces it to wait for process to finish
    sCmd="shutdown /l"
    oShell.run sCmd
    Hmm, I'm getting an error on Line 3 character 1, the system cannot find the specified file.

  10. #25

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,271
    Thank Post
    884
    Thanked 2,749 Times in 2,322 Posts
    Blog Entries
    11
    Rep Power
    785
    Are you sure that the file is there and that the user has read access to it? Try it with notepad just to make sure:

    sCmd="notepad.EXE"

  11. #26
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    252
    Thank Post
    86
    Thanked 8 Times in 6 Posts
    Rep Power
    16
    Quote Originally Posted by SYNACK View Post
    Are you sure that the file is there and that the user has read access to it? Try it with notepad just to make sure:

    sCmd="notepad.EXE"
    Just tried that, and it worked perfectly, started notepad on login, and logged me out when I closed notepad. I tried the game path again, and it gave me the cannot find the file specified message again. So I copied the location directly from the code, between the " signs since it has spaces in it, and pasted it into start>run, and the game launched perfectly, so I know the file path is good. Could it be that it's not accepting spaces?

    I tried something else too. I added the C:\Program Files\Microsoft Games\Age Of Empires etc folder to the system path, and tried just adding EMPIRES2.exe in the code to see if that was the issue. Doesn't work then either, system cannot find the file specified.

    Thanks for your help!

  12. #27
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    252
    Thank Post
    86
    Thanked 8 Times in 6 Posts
    Rep Power
    16
    Quote Originally Posted by jamesb View Post
    If you start the games through a batch file instead you could use the following:

    Code:
     
    start /wait "C:\Games\Starcraft.exe"
    shutdown /l
    Just tried this solution out of desperation. Still doesn't work. I end up getting a command prompt window that comes up with the first line, start /wait "C:\Program Files\Microsoft Games\Age Of Empires II\EMPIRES2.EXE" and then just sits there and another command prompt window pops up and starts the command at a wierd place that has nothing to do with the script. I close that window, and the original command window asks me if I want to terminate the process. If I say no, it shows shutdown /1, disappears, and doesn't logout. If I choose yes, it closes, and doesn't log out as well. Thanks anyway!

  13. #28

    Join Date
    Feb 2009
    Posts
    460
    Thank Post
    66
    Thanked 34 Times in 21 Posts
    Blog Entries
    1
    Rep Power
    19
    [QUOTE=link470;319261] it shows shutdown /1, QUOTE]

    Just to check is that 1 or L ?

  14. #29
    User3204's Avatar
    Join Date
    Aug 2006
    Location
    Wirral
    Posts
    769
    Thank Post
    55
    Thanked 66 Times in 62 Posts
    Rep Power
    34
    Quote Originally Posted by link470 View Post
    Just tried this solution out of desperation. Still doesn't work. I end up getting a command prompt window that comes up with the first line, start /wait "C:\Program Files\Microsoft Games\Age Of Empires II\EMPIRES2.EXE" and then just sits there and another command prompt window pops up and starts the command at a wierd place that has nothing to do with the script. I close that window, and the original command window asks me if I want to terminate the process. If I say no, it shows shutdown /1, disappears, and doesn't logout. If I choose yes, it closes, and doesn't log out as well. Thanks anyway!
    You need to do:

    Code:
    start /wait "Title" "C:\program folder\application.exe"
    so

    Code:
    start /wait "StarCraft" "C:\Games\Starcraft.exe"
    Otherwise it interprets the stuff between the "" as a title\name.

  15. #30
    link470's Avatar
    Join Date
    Nov 2007
    Location
    Canada
    Posts
    252
    Thank Post
    86
    Thanked 8 Times in 6 Posts
    Rep Power
    16
    Quote Originally Posted by DAckroyd View Post
    Quote Originally Posted by link470 View Post
    it shows shutdown /1,
    Just to check is that 1 or L ?
    It's a one [1].

    Quote Originally Posted by User3204 View Post
    You need to do:

    Code:
    start /wait "Title" "C:\program folder\application.exe"
    so

    Code:
    start /wait "StarCraft" "C:\Games\Starcraft.exe"
    Otherwise it interprets the stuff between the "" as a title\name.
    The event I was prepping these for is over so no pressure for time now [event went great! ended up just having the machines start Starcraft from the Startup folder, and luckily, they never wanted to quit Starcraft! They just played that all night then shut the machines down lol] but I'm keeping the machines and making modifications to them so I can use them again

    I'll give that a shot, thanks!



SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Auto Defrag & Reducing User Profiles
    By shane-meh in forum Windows Server 2000/2003
    Replies: 10
    Last Post: 7th April 2009, 04:33 PM
  2. Auto log off
    By James2k in forum Windows
    Replies: 6
    Last Post: 3rd December 2008, 11:25 PM
  3. Permitting only one user to log on to a workstation
    By ctbjs in forum How do you do....it?
    Replies: 8
    Last Post: 5th September 2007, 04:27 PM
  4. Replies: 4
    Last Post: 12th July 2006, 10:59 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •