Solved

Run .exe only once on each PC in AD domain.

Posted on 2011-02-16
4
642 Views
Last Modified: 2012-05-11
I need to run the following command (which will install the Citrix Online Plugin with specific provisions) run ONCE on each computer in my domain.

\\domain.domain.com\NETLOGON\CitrixOnlinePluginFull.exe  /silent ADDLOCAL="ICA_Client, PN_Agent,SSON" ENABLE_SSON=YES ENABLE_DYNAMIC_CLIENT_NAME=YES SERVER_LOCATION="Citrixserv"

Open in new window


I have a script that I found online that SHOULD take care of it, but I keep getting an Expected: end of statement error after the first quotation mark under ADDLOCAL.

This is the script:

Dim objShell, objFSO

Const ForWriting = 2

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

If Not objFSO.FileExists("C:\Marker.txt") Then
    objShell.Run "\\domain.domain.com\NETLOGON\CitrixOnlinePluginFull.exe /silent ADDLOCAL="ICA_Client, PN_Agent,SSON" ENABLE_SSON=YES ENABLE_DYNAMIC_CLIENT_NAME=YES SERVER_LOCATION="Citrixserv" "

    Set objMarker = objFSO.OpenTextFile("C:\Marker.txt", ForWriting, True)
    objMarker.Write "CitrixOnlinePlugin.exe has ran!"
    objMarker.Close
End If

Set objShell = Nothing
Set objFSO = Nothing
Set objMarker = Nothing

Open in new window


Can anyone help with making VBScript recognize that this command needs to run in it's entirety?

Thanks in advance.
0
Comment
Question by:Tekz08
4 Comments
 
LVL 32

Expert Comment

by:it_saige
ID: 34912143
Try:
Dim objShell, objFSO

Const ForWriting = 2

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

If Not objFSO.FileExists("C:\Marker.txt") Then
    objShell.Run "\\domain.domain.com\NETLOGON\CitrixOnlinePluginFull.exe /silent ADDLOCAL="""ICA_Client, PN_Agent,SSON""" ENABLE_SSON=YES ENABLE_DYNAMIC_CLIENT_NAME=YES SERVER_LOCATION="""Citrixserv""""

    Set objMarker = objFSO.OpenTextFile("C:\Marker.txt", ForWriting, True)
    objMarker.Write "CitrixOnlinePlugin.exe has ran!"
    objMarker.Close
End If

Set objShell = Nothing
Set objFSO = Nothing
Set objMarker = Nothing

Open in new window

HTH,

-saige-
0
 
LVL 65

Assisted Solution

by:RobSampson
RobSampson earned 350 total points
ID: 34912785
There's not enough quotes on that line.  It should be:

    objShell.Run "\\domain.domain.com\NETLOGON\CitrixOnlinePluginFull.exe /silent ADDLOCAL=""ICA_Client, PN_Agent,SSON"" ENABLE_SSON=YES ENABLE_DYNAMIC_CLIENT_NAME=YES SERVER_LOCATION=""Citrixserv""", 0, True

Regards,

Rob.
0
 
LVL 9

Accepted Solution

by:
Tomas Valenta earned 150 total points
ID: 34915424
better should be to check existence of the file: C:\Program Files\Citrix\ICA Client\pnagent.exe
Somebody can delete your Marker.txt.
0
 
LVL 1

Author Comment

by:Tekz08
ID: 34921458
Rob: Thanks, your version of the command did work for me.

Tominov: This was actually a much better idea than what I had planned. Thanks for pointing me in that direction.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

760 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

19 Experts available now in Live!

Get 1:1 Help Now