Solved

WMI Event Watcher

Posted on 2012-03-19
5
191 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 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

27 Experts available now in Live!

Get 1:1 Help Now