[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2011-02-16
4
Medium Priority
?
656 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 34

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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

656 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