Solved

GPO 2003 server and logoff scripts

Posted on 2013-01-17
6
376 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…

738 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