Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Confused the Duck Out [VB6]


Matt
 Share

Recommended Posts

I was fooling around in VB6 and I wrote 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"

End If

If Dir(App.Path & "\folder1\folder2\" & User & "\") = "" Then

MkDir (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

```

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

```
Link to comment
Share on other sites

> ```
>
> 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...