Well, first you need to remove the apostrophe before the "As" that is commenting out the variable definition:
Dim di As DirectoryInfo = Directory.CreateDirectory("C:\mydir")
Second, are you getting any error messages? If so, what?
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
Several commands don't exist in Script.
I see PHV referred you to the FileSystemObject in the Script forum, which is better.
I have never used the Directory object before and I've heard, it was kind of buggy anyway...
Major difference between VB and VBScript:
In VBScript you don't dimension variables as a certain type, just Dim them.
String operations like Mid or Mid$ don't exist in VBScript, you need to work around with left and right functions.
Here are two official comparison lists:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.