?
Solved

script help please

Posted on 2014-12-19
4
Medium Priority
?
122 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 1000 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 57

Accepted Solution

by:
Bill Prew earned 1000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

765 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