Solved

GPO 2003 server and logoff scripts

Posted on 2013-01-17
6
370 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
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
 

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 24

Expert Comment

by:lionelmm
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

Join & Write a Comment

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now