Solved

GPO 2003 server and logoff scripts

Posted on 2013-01-17
6
375 Views
Last Modified: 2013-08-31
I have the following question, I have a windows 2003 domain, now I have to use a logoff script. It is visible, it is working but now: in logoff script there is a cmd script file. In this cmd file I starting a second script, a vbs script. Working fine. But now, each time the cmd script is visible and I'm looking to a method to hide this or minimize the cmd script.

Does someone got some experience how to do this via Group policy?
0
Comment
Question by:Davy_VK_72
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 500 total points
ID: 38789033
Below is a small VBS script that will allow you to run batch file hidden.

Option Explicit

Dim i, strArguments, wshShell

If WScript.Arguments.Count = 0 Then Syntax
If WScript.Arguments(0) = "/?" Then Syntax

strArguments = ""

For i = 0 To WScript.Arguments.Count - 1
	strArguments = strArguments & " " & WScript.Arguments(i)
Next

Set wshShell = CreateObject( "WScript.Shell" )
wshShell.Run Trim( strArguments ), 0, False
Set wshShell = Nothing


Sub Syntax
	Dim strMsg
	strMsg = "RunNHide.vbs,  Version 2.00" & vbCrLf _
	       & "Run a batch file or (console) command in a hidden window" & vbCrLf _
	       & vbCrLf _
	       & "Usage:  RUNNHIDE.VBS  some_command  [ some_arguments ]" & vbCrLf _
	       & vbCrLf _
	       & "Where:  ""some_command""    is the batch file or (console) command" & vbCrLf _
	       & "                          you want to run hidden" & vbCrLf _
	       & "        ""some_arguments""  are optional arguments for ""some_command""" & vbCrLf _
	       & vbCrLf _
	       & "Based on a ""one-liner"" by Alistair Johnson" & vbCrLf _
	       & "www.microsoft.com/technet/scriptcenter/csc/scripts/scripts/running/cscte009.mspx" _
	       & vbCrLf & vbCrLf _
	       & "Written by Rob van der Woude" & vbCrLf _
	       & "http://www.robvanderwoude.com"
	WScript.Echo strMsg
	WScript.Quit 1
End Sub

Open in new window

0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 38789040
Credit for where this actually came from.
http://www.robvanderwoude.com/sourcecode.php?src=runnhide_vbs
0
 
LVL 25

Expert Comment

by:Tony Giangreco
ID: 38789134
Here is more info regarding the logoff script

http://technet.microsoft.com/en-us/library/cc739591(v=ws.10).aspx
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Davy_VK_72
ID: 38789168
the problem is, that I starting a cmd script, and this script is starting another vb script, but this vb script is starting only after the check of a file on the workstation. If there is no file, vb script is not starting. But the cmd script is starting up and is visible, the question is how to configure gpo setting (logoff scripts) to minimize the cmd script.
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 38789186
You would use the runhide.vbs and then call your CMD script.
0
 
LVL 25

Expert Comment

by:Lionel MM
ID: 38792895
You hide logon and logoff scripts with these settings in GPO--see picture
Computer config--Admin templates--system--scripts
Hide-Logoff-Scripts.jpg
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question