Solved

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

Posted on 2011-02-16
4
645 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 33

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

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

Suggested Solutions

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

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

23 Experts available now in Live!

Get 1:1 Help Now