Solved

WMI Event Watcher

Posted on 2012-03-19
5
188 Views
Last Modified: 2012-06-27
how do i replace the folder name with a variable.
"Win32_Directory.Name=\"c:\\\\Development\\\\temp\""


like.
Win32_Directory.Name=\"@Correct_File""
0
Comment
Question by:aneilg
  • 3
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 290 total points
ID: 37738834
If you mean by SQL code please see below:


declare @string varchar(max),
            @path varchar(255)

set @path = '"c:\\\\Development\\\\temp\"'
SET @string = '"Win32_Directory.Name=\' + @path

print (@string);
0
 
LVL 39

Expert Comment

by:lcohan
ID: 37738856
If you need this at the OS level in CMD or batch file you should use parameters like %1, %2, ...
So in the batch or command file would be something like:



"Win32_Directory.Name="%1

Where %1 = \"c:\\\\Development\\\\temp\""
0
 

Author Comment

by:aneilg
ID: 37741356
sorry for the Confusion, but i am using the WMI Event Watcher Task, and its WMI Options, WqlQuerySource.
0
 
LVL 39

Expert Comment

by:lcohan
ID: 37744359
OK, so you have two options in my opinion - if you have the WQL query you can modify it as I mentioned above with the sql example using variables or if you have it in SSIS task you can add task parameter/value:

http://www.simple-talk.com/sql/ssis/passing-variables-to-and-from-an-ssis-task/
http://msdn.microsoft.com/en-us/library/cc280502.aspx
0
 

Author Closing Comment

by:aneilg
ID: 37786872
thanks
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now