Page 1 of 1 1
Topic Options
#171212 - 2006-12-08 01:01 AM Getting a logon script to "restore"
hornet Offline
Lurker

Registered: 2006-12-07
Posts: 1
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

Top
#171213 - 2006-12-08 01:53 AM Re: Getting a logon script to "restore" [Re: hornet]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
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.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#171214 - 2006-12-08 02:39 AM Re: Getting a logon script to "restore" [Re: hornet]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
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.

.

Top
#171218 - 2006-12-08 07:26 AM Re: Getting a logon script to "restore" [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
to actually answer the original question, I don't remember which one it was.
try setconsole() with "show" and "foreground"
_________________________
!

download KiXnet

Top
#171223 - 2006-12-08 09:23 AM Re: Getting a logon script to "restore" [Re: hornet]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
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.

Top
#171224 - 2006-12-08 10:23 AM Re: Getting a logon script to "restore" [Re: Witto]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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.
_________________________
!

download KiXnet

Top
#171228 - 2006-12-08 11:29 AM Re: Getting a logon script to "restore" [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
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.


.

Top
#171229 - 2006-12-08 12:36 PM Re: Getting a logon script to "restore" [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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.
_________________________
!

download KiXnet

Top
#171231 - 2006-12-08 01:43 PM Re: Getting a logon script to "restore" [Re: Lonkero]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
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.
_________________________
Actually I am a Rocket Scientist! \:D

Top
#171238 - 2006-12-08 05:26 PM Re: Getting a logon script to "restore" [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
error with a delay? why not pause?
_________________________
!

download KiXnet

Top
#171249 - 2006-12-08 06:55 PM Re: Getting a logon script to "restore" [Re: Lonkero]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#171252 - 2006-12-08 07:27 PM Re: Getting a logon script to "restore" [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Okay if that is his issue then you're correct removing setconsole would not correct it.
Top
#171255 - 2006-12-08 07:43 PM Re: Getting a logon script to "restore" [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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.
_________________________
!

download KiXnet

Top
#171259 - 2006-12-08 08:11 PM Re: Getting a logon script to "restore" [Re: Lonkero]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#171265 - 2006-12-08 10:43 PM Re: Getting a logon script to "restore" [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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 \:\)
_________________________
!

download KiXnet

Top
#171268 - 2006-12-08 11:10 PM Re: Getting a logon script to "restore" [Re: Lonkero]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#171270 - 2006-12-09 12:05 AM Re: Getting a logon script to "restore" [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.146 seconds in which 0.116 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org