?
Solved

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

Posted on 2011-02-16
4
Medium Priority
?
661 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 35

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 1400 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 600 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

830 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