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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable within fso.deletefile command. Help

Status
Not open for further replies.

Powertron

Technical User
Nov 25, 2011
2
US
I'm a beginner. Can't get syntax right.

the command is like this:
fso.deletefile("c:\vrsv\temp\variable\*.*")

the variable is what changes depending on a regread I do earlier.
I've used chr(34) & ...
If you anyone could assist.
anyone has a tutorial on inserting variables in vb commands include that too.
ty
 
You wanted this ?
fso.deletefile("c:\vrsv\temp\[!]" & [/!]variable[!] & "[/!]\*.*")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
yes thank you. but I thought I tried that....
I'll test again . thank you very much!!
 
if variable contains a space (eg. "old files") then encapsulate the whole path with chr(34)

Code:
fso.deletefile(chr(34) & "c:\vrsv\temp\" & variable & "\*.*" & chr(34))

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top