Solved

WMI Event Watcher

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql query 8 50
Can I convert a numeric string into referenced values with an SQL query? 10 42
SQL Pivot Rows To Columns 10 55
This query failed in sql 2014 5 32
After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

832 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