[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Passing a variable where select * wants a literal, VB6

Posted on 2004-08-11
3
Medium Priority
?
267 Views
Last Modified: 2012-05-05
Code:

For Each Process In GetObject("winmgmts:").ExecQuery("select * from Win32_Process where
Name='cmd.exe'")
        Process.Terminate
Next

I need to pass a variable to the Name= instead of a literal (here I put cmd.exe).  This should be easy but can't think of the answer. tried this no help:

Name='" & myVar)

0
Comment
Question by:bluedragon99
[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
3 Comments
 
LVL 1

Author Comment

by:bluedragon99
ID: 11774876
Need to pass process.name
0
 
LVL 7

Accepted Solution

by:
Tanglin05 earned 2000 total points
ID: 11774890
Did you try:

Name='"& myVar &"'")
0
 
LVL 1

Author Comment

by:bluedragon99
ID: 11774938
Perfect!  Thanks for the quick solution.
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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Simple Linear Regression
Introduction to Processes

650 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