Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

GPO 2003 server and logoff scripts

Posted on 2013-01-17
6
Medium Priority
?
384 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 1500 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
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!

 

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 26

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
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). …
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

885 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