Link to home
Start Free TrialLog in
Avatar of Tekz08
Tekz08Flag for United States of America

asked on

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

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.
Avatar of it_saige
it_saige
Flag of United States of America image

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-
SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tekz08

ASKER

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.