Solved

Workshare script

Posted on 2013-02-04
4
461 Views
Last Modified: 2013-02-13
How do I create a login script which will run ONLY once for users on Citrix which will run "Workshare.Professional.UserInit.exe"?
0
Comment
Question by:Blakie32
  • 2
  • 2
4 Comments
 
LVL 24

Expert Comment

by:Coralon
ID: 38857797
That's pretty easy to do.  You will create a script that checks to see if a registry key exists in HKCU, and if it does exit.  If it does not, then you run the application, and create the key on success.  

The only real question is your language.  :-)  I've done it before in vbscript, can theoreticallyb e done in batch, can absolutely be done in powershell.. what's your fancy?

You run the script from usrlogn1.cmd (I have an article here on how to use this if you aren't familiar with it).

How usrlogon processing works

Coralon
0
 

Author Comment

by:Blakie32
ID: 38861970
I forgot to mention that I am new to all of this so maybe it can be done in a batch file?

I have read your documentation and it is totally over my head.  As stated above:  I am new to all of this.  :)

I will re-read again (and again) and try to create this and will let you know if it worked or not.  Thanks for getting back to me.

Jackie
0
 
LVL 24

Accepted Solution

by:
Coralon earned 500 total points
ID: 38862350
You bet..

Here's a sample vbscript (partly made generic):
(this is actually a production script that I have used in the past)

Option Explicit

'============================== Objects ===========================================================
Dim fso
Set fso							= CreateObject ("Scripting.FileSystemObject")

Dim wshShell
Set wshShell					= CreateObject ("WScript.Shell")

'============================== Script variables ==================================================
Dim sBaseKey					'The base key for the script
sBaseKey						= "HKCU\Software\MyCompany\Scripts\MyScriptName"
Dim bHasBeenRUn
bHasBeenRun						= "no"

'============================== Main Body =========================================================
On Error Resume Next
	Dim sCheck
	sCheck						= lcase(wshShell.RegRead (sBaseKey + "\HasBeenRun"))
	If sCheck					= "yes" then
		bHasBeenRun				= "yes"
	End If
On Error GoTo 0

If lcase(bHasBeenRun)			= "yes" then
	Quit()
End If

'now run the app
'the path to the exe is the actual path, the 1 means a normal window, vbFalse says don't wait for it to return
shell.Run "<path to exe>\ Workshare.Professional.UserInit.exe", 1, vbFalse



Function Quit()
	Set wshShell				= Nothing
	Set fso						= Nothing
	WScript.Quit
End Function

Open in new window


Coralon
0
 

Author Comment

by:Blakie32
ID: 38887898
Ok thank you so much for this!  I will definitely give it a try.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.

910 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

25 Experts available now in Live!

Get 1:1 Help Now