hornet
(Lurker)
2006-12-08 01:01 AM
Getting a logon script to "restore"

Hi all,

New to KiXtart scripts here. I've done a bit of research, and managed to put together a basic login script.

However since its nice and graphical, I would like it to be displayed when the user logs in. By default the login script is minimised. I've found the SetConsole(Maximize) command, but that will make it maximised (it too big, compared to just restoring it).

Is there anyway I can make the script run in "restored" mode, so its the standard size?

Thanks in advance.
Adrian


Gargoyle
(MM club member)
2006-12-08 01:53 AM
Re: Getting a logon script to "restore"

I hate to rain on your parade, but I am of the firm belief that it should never be seen. A user will find it interesting the first time they log in, and from that point forward they will find it annoying (I speak as a user that had to do this, and as an admin that had to listen to the users complain about it).

However the "restore" is generally remembered by Windows and will restore your window to what it was set as the last occurance.


NTDOCAdministrator
(KiX Master)
2006-12-08 02:39 AM
Re: Getting a logon script to "restore"

It would be tricky to do it "right".

You would need to query the current size of the console. Not an easy task as some systems may not respond correctly with that information.

Then you would need to adjust the console size (but that would not take affect until the next time they log on).

It is possible to do though, but not showing any logon screen would probably be a better choice.

.


LonkeroAdministrator
(KiX Master Guru)
2006-12-08 07:26 AM
Re: Getting a logon script to "restore"

to actually answer the original question, I don't remember which one it was.
try setconsole() with "show" and "foreground"


Witto
(MM club member)
2006-12-08 09:23 AM
Re: Getting a logon script to "restore"

When we execute our script on login, the screen runs minimized, how do we get it visible?
But as said in a previous post in this thread, I also like quiet, fast and good login scripts.


LonkeroAdministrator
(KiX Master Guru)
2006-12-08 10:23 AM
Re: Getting a logon script to "restore"

me too.
but that doesn't mean nobody else can like noisy logon.


just as music, a lot of ppl want to have their music under 80dB and some don't.


NTDOCAdministrator
(KiX Master)
2006-12-08 11:29 AM
Re: Getting a logon script to "restore"

I may be wrong, but I think Witto and Jooel are thinking of something else.

As I read his request the DOS CONSOLE is not the size he wants, thus he tried the SETCONSOLE("maximize") and doesn't like it. How to restore back to the way it was.

Remove the SETCONSOLE coding and it should run the previous default settings of the console.

To size the console how you want will need to do as I explained earlier. If SILVER PLATTER code is required then he needs to request that.


.


LonkeroAdministrator
(KiX Master Guru)
2006-12-08 12:36 PM
Re: Getting a logon script to "restore"

read again.
he said it's minimized and he wants it to show.
but the maximize doesn't work for him, that he said.

so, he is looking for a way to SHOW the window, instead of having it minimized or maximized.

nothing special in that.
and no, removing the setconsole line does not fix his issue.


Glenn BarnasAdministrator
(KiX Supporter)
2006-12-08 01:43 PM
Re: Getting a logon script to "restore"

Hmm..

Login scripts imply a domain. Default domain settings currently define login scripts to be run minimized. I have a GPO defined to make them visible, with no Kix commands whatsoever to change the console settings.
GPO settings:
Code:
Administrative Templates
 System/Scripts
   Policy Setting 
    Run legacy logon scripts hidden Disabled 
    Run logon scripts synchronously Enabled 
    Run logon scripts visible       Enabled 

The first setting causes traditional login scripts to not run hidden, while the third setting runs all, including GPO scripts, in a normal window. I use the second setting to insure that the login script completes before the desktop is presented - that's just my preference here.

The login script I use (latest* version will be available on my web site on 12/09/2006) is designed to run visible, but runs and disappears so fast is is unobtrusive - unless there is a problem. If a problem occurs, the resource in error is displayed in red, and the system waits several seconds so the user can identify the problem and present that info to the help desk. The script also displays system outage messages with a short delay only when messages are present.

Glenn

* - current version is available now, new version improves the documentation, and adds Map by OU, including OU-based Path-Rewriting.


LonkeroAdministrator
(KiX Master Guru)
2006-12-08 05:26 PM
Re: Getting a logon script to "restore"

error with a delay? why not pause?

Glenn BarnasAdministrator
(KiX Supporter)
2006-12-08 06:55 PM
Re: Getting a logon script to "restore"

That's also personal preference, and configurable. I used to have it pause by default, but several clients asked for it to only delay so it would not impact their users if resources were unavailable during maintenance periods.

Glenn


NTDOCAdministrator
(KiX Master)
2006-12-08 07:27 PM
Re: Getting a logon script to "restore"

Okay if that is his issue then you're correct removing setconsole would not correct it.

LonkeroAdministrator
(KiX Master Guru)
2006-12-08 07:43 PM
Re: Getting a logon script to "restore"

glen, not sure.
some delay does interfere with the user.
as does any GUI.
having a pause just makes sure the user knows something doesn't work.
but like you said, it's just a personal preference.


Glenn BarnasAdministrator
(KiX Supporter)
2006-12-08 08:11 PM
Re: Getting a logon script to "restore"

Obviously, personal preference was Pause, but I got enough feedback to change it to delay. I'm thinking that I should change it to a loooong pause (15 minutes?) that can be interrupted by any keystroke. This way, if you run a scheduled task with your personal credentials, and a resource is unavailable, it won't hang forever waiting for your login script to finish.

Waddaya think?

Glenn


LonkeroAdministrator
(KiX Master Guru)
2006-12-08 10:43 PM
Re: Getting a logon script to "restore"

minutes?
ok, anything above 1 minute should be ok alraedy.
there is still the change for user to call helpdesk and say he saw error.
helpdesk asks what the error was and he says, dunno, I didn't read it, it just said error and something.

ja, that considered, 15min is fine \:\)


Glenn BarnasAdministrator
(KiX Supporter)
2006-12-08 11:10 PM
Re: Getting a logon script to "restore"

Errors cause a log entry to be created that the helpdesk can access to get the error info, so the end-user doesn't have to "know" what the problem is (or was).

Glenn


LonkeroAdministrator
(KiX Master Guru)
2006-12-09 12:05 AM
Re: Getting a logon script to "restore"

even better.
k, now I understand some second delay. say from 15 seconds up would be sufficient.

btw, I notice now I took this discussion way of topic.
sorry.