Solved

Workshare script

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

Expert Comment

by:Coralon
Comment Utility
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
Comment Utility
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 23

Accepted Solution

by:
Coralon earned 500 total points
Comment Utility
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
Comment Utility
Ok thank you so much for this!  I will definitely give it a try.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
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.

772 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

10 Experts available now in Live!

Get 1:1 Help Now