Solved

Workshare script

Posted on 2013-02-04
4
463 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to restrict a file from copy/edit/save/print/saveas? 8 71
Clipboard Manager for Windows 7 5 66
MSP multi use software 4 121
Map software access 4 30
If your app took Google’s lash recently, here are the 5 most likely reasons.
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!
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

776 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