?
Solved

Workshare script

Posted on 2013-02-04
4
Medium Priority
?
468 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
[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
  • 2
  • 2
4 Comments
 
LVL 25

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 25

Accepted Solution

by:
Coralon earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 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