+ Post New Thread
Results 1 to 11 of 11
How do you do....it? Thread, Stop users closing bat/cmd shell at logon in Technical; I know its possible to run bat/cmd files hidden but is there a way to display the window but remove ...
  1. #1
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,430
    Thank Post
    79
    Thanked 90 Times in 86 Posts
    Rep Power
    32

    Stop users closing bat/cmd shell at logon

    I know its possible to run bat/cmd files hidden but is there a way to display the window but remove the close button?

  2. IDG Tech News

  3. #2
    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,051
    Blog Entries
    1
    Thank Post
    104
    Thanked 438 Times in 379 Posts
    Rep Power
    114

    Re: Stop users closing bat/cmd shell at logon

    Here is a KB article about it.

    http://support.microsoft.com/default.aspx/kb/818361

    You'll need to put that code in a VBS script then have your login scripts call it to disable their close buttons.

  4. #3
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,430
    Thank Post
    79
    Thanked 90 Times in 86 Posts
    Rep Power
    32

    Re: Stop users closing bat/cmd shell at logon

    Will this work as a script? as its intended for vb or vb .net.

  5. #4
    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,051
    Blog Entries
    1
    Thank Post
    104
    Thanked 438 Times in 379 Posts
    Rep Power
    114

    Re: Stop users closing bat/cmd shell at logon

    You'll have to convert it.

  6. #5
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,430
    Thank Post
    79
    Thanked 90 Times in 86 Posts
    Rep Power
    32

    Re: Stop users closing bat/cmd shell at logon

    How would i go about converting VB to VBS? Dont even know how to declare an external procedure so i wouldnt even get past line 1.

  7. #6

    Join Date
    Sep 2006
    Location
    Essex
    Posts
    745
    Thank Post
    1
    Thanked 26 Times in 24 Posts
    Rep Power
    18

    Re: Stop users closing bat/cmd shell at logon

    What does your BAT/CMD script do? It might be easier to convert it to a VB script, these run silently.

  8. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    7,025
    Thank Post
    1,085
    Thanked 641 Times in 598 Posts
    Rep Power
    209

    Re: Stop users closing bat/cmd shell at logon

    Quote Originally Posted by djm968
    What does your BAT/CMD script do? It might be easier to convert it to a VB script, these run silently.
    I agree with djm968, beat me to it

    If you can tell us what the bat files do then we can try and help you convert it, unless you can convert it yourself

  9. #8

    Join Date
    Feb 2006
    Posts
    1,193
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Stop users closing bat/cmd shell at logon

    @djm968 & gecko : Note OP wants the CMD window to appear (I assume for diagnostic purposes or to freak out the lusers) but with the close button removed so that users can't terminate login scripts.



    The problem you'll have converting KB818361 code above is calls made to user32.dll unless you can get COM wrappers for them.

    Best thing would probably be to use Sharp Develop IDE or the command line compilerfor vb.net if your target machines all have .net runtime installed.

    Alternatively you could install the AutoIT ActiveX doodah and call that from VBS to control the console window.

  10. #9

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,284
    Blog Entries
    2
    Thank Post
    598
    Thanked 879 Times in 617 Posts
    Rep Power
    287

    Re: Stop users closing bat/cmd shell at logon

    Put everything in a GUI AutoIt script and you could even make the log window lime green-on-black

  11. #10
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,430
    Thank Post
    79
    Thanked 90 Times in 86 Posts
    Rep Power
    32

    Re: Stop users closing bat/cmd shell at logon

    Yup i want the window to appear for the reasons NetworkGeezer stated and i can recode the bat/cmd files as vbscripts, which i may just do. I may just vbscript it and create my own dialog boxes if all else fails.

    @NetworkGeezer: Thanks for the info, ill look into it.

  12. #11
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,641
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    29

    Re: Stop users closing bat/cmd shell at logon

    You will find it easier to code the dialogs in AutoIt than VB. With VB you will either need to use custom components (which will have to be deployed), or script Internet Explorer. Scripting IE certainly won't speed up your logon process!!

    If you do go down the custom component route, you could try looking at JsWare. The web site is a bit confusing but there is some good stuff.

SHARE:
+ Post New Thread

Similar Threads

  1. No Logon name after addding users by DSADD
    By tosca925 in forum Windows
    Replies: 8
    Last Post: 23rd May 2011, 08:31 PM
  2. EPortal logon fails for some users
    By robk in forum MIS Systems
    Replies: 0
    Last Post: 30th October 2007, 11:06 AM
  3. Replies: 6
    Last Post: 9th May 2007, 09:22 PM
  4. restricting users to only one logon
    By edie209 in forum Windows
    Replies: 17
    Last Post: 11th July 2006, 04:56 PM

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
  •