Matt Posted November 18, 2012 Author Share Posted November 18, 2012 I was fooling around in VB6 and I wrote this.```Dim User As StringDim Pass As StringUser = txtUser.TextPass = txtPassword.TextIf Dir(App.Path & "\folder1\folder2\" & User & "\") <> "" Thenmsgbox "Worked"End IfIf Dir(App.Path & "\folder1\folder2\" & User & "\") = "" ThenMkDir (App.Path & "\folder1\folder2\" & User & "\")End If```I have both folders (folder1 and folder2) where they aught to be. The first time I ran this, it made the folder as it wasn't there. The second time, it brought up a RTE 75 over```MkDir (App.Path & "\folder1\folder2\" & User & "\")```I've been looking through this for the past hour and I'm frustrated and extremely confused, What am I not doing/doing wrong? Link to comment Share on other sites More sharing options...
JohnPony Posted November 18, 2012 Share Posted November 18, 2012 ```If Dir(App.Path & "\System\Users\" & User & "\") = "" Then```What are you doing here?change that toIf Dir(App.Path & "\folder1\folder2\" & User & "\") = "" ThenAlso, just use this.```Dim User As StringDim Pass As StringUser = txtUser.TextPass = txtPassword.TextIf Dir(App.Path & "\folder1\folder2\" & User & "\") <> "" Thenmsgbox "Worked"elseMkDir (App.Path & "\folder1\folder2\" & User & "\")End If``` Link to comment Share on other sites More sharing options...
Matt Posted November 18, 2012 Author Share Posted November 18, 2012 > ```> > If Dir(App.Path & "\System\Users\" & User & "\") = "" Then> > ```> > What are you doing here?> > change that to> > If Dir(App.Path & "\folder1\folder2\" & User & "\") = "" Then> > Also, just use this.> > ```> > Dim User As String> > Dim Pass As String> > User = txtUser.Text> > Pass = txtPassword.Text> > If Dir(App.Path & "\folder1\folder2\" & User & "\") <> "" Then> > msgbox "Worked"> > else> > MkDir (App.Path & "\folder1\folder2\" & User & "\")> > End If> > ```My bad. I renamed the folder names for simplicity's sake. The line of code you pointed out to change is exactly that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now