Solved

script help please

Posted on 2014-12-19
4
119 Views
Last Modified: 2014-12-19
Hi all I am writing a vb script to install ultraedit but I am having trouble with the concatenation.
strUEdit_Path = "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit"
strCommand2 = strUEdit_Path & "\uedit32.exe" & Chr(34) & " /lic,e="123546|yuhmhilk"" & Chr(34)
WScript.Echo strCommand2
	If objFSO.FolderExists(strUEdit_Path) Then
	WshShell.Run strCommand2,0,True 
	End If

Open in new window


The strcommand2 should translate to the line below
C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\uedit32.exe /lic,e="123546|yuhmhilk"
No matter how I add quotes or chr(34) I keep end of statement error. Please help
0
Comment
Question by:xzay1967
[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
  • 2
4 Comments
 
LVL 70

Assisted Solution

by:Qlemo
Qlemo earned 250 total points
ID: 40509800
strUEdit_Path = "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit"
strCommand2 = strUEdit_Path & "\uedit32.exe /lic,e=""123546|yuhmhilk"" "
WScript.Echo strCommand2
If objFSO.FolderExists(strUEdit_Path) Then
  WshShell.Run strCommand2,0,True 
End If

Open in new window

0
 
LVL 54

Accepted Solution

by:
Bill Prew earned 250 total points
ID: 40510091
Since the editor path has spaces in it I think you will need:

strUEdit_Path = "C:\Program Files (x86)\IDM Computer Solutions\UltraEdit"
strCommand2 = """" & strUEdit_Path & "\uedit32.exe"" /lic,e=""123546|yuhmhilk"""
WScript.Echo strCommand2
If objFSO.FolderExists(strUEdit_Path) Then
  WshShell.Run strCommand2,0,True 
End If

Open in new window

~bp
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 40510096
Correct, but that looks awful :-)
0
 

Author Closing Comment

by:xzay1967
ID: 40510097
Both solutions worked thanks. I tried both and wanted to be fair. I hope that was ok, thanks again
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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 …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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