Solved

script help please

Posted on 2014-12-19
4
118 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
  • 2
4 Comments
 
LVL 69

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 69

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

679 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