Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax help with an inputbox 1

Status
Not open for further replies.

JimmyZ1

Technical User
Mar 31, 2004
397
I need help switching this to an input box

Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_Datafile Where name = 'c:\\Scripts\\Adsi.vbs'")


if you change c:\\scripts\\adsi.vbs to input1 like this

Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_Datafile Where name = 'input1'")


for some reason it stops working... and i've tried the double \\ between the directory name actually i've tried both, it's probably some crazy syntax....
 
[tt]>Set colFiles = objWMIService.ExecQuery _
> ("Select * from CIM_Datafile Where name = 'input1'")
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_Datafile Where name = '" & _
replace(input1,"\","\\") & "'")
[/tt]
User's input should be something closer to what they are familier with like c:\script\adsi.vbs rather than escaped form c:\\script\\adsi.vbs. Otherwise, no need of the replace() part.

- tsuji
 
That's twice you've really helped me, thanks again I don't fully understand vbs but i'm learning and atleast i can narrow down my problems to 1 line.

thanks again and again
 
Thanks. That's the secret of debugging and soon you learn others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top