+ 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,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42

    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. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,804
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    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.

  3. #3
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42

    Re: Stop users closing bat/cmd shell at logon

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

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,804
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Stop users closing bat/cmd shell at logon

    You'll have to convert it.

  5. #5
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42

    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.

  6. #6

    Join Date
    Sep 2006
    Location
    Essex
    Posts
    783
    Thank Post
    1
    Thanked 33 Times in 31 Posts
    Rep Power
    24

    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.

  7. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,807
    Thank Post
    3,320
    Thanked 1,056 Times in 977 Posts
    Rep Power
    365

    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

  8. #8

    Join Date
    Feb 2006
    Posts
    1,187
    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.

  9. #9

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    640
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324

    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

  10. #10
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42

    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.

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

    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, 10: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
  •