• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Anyone with more than basic VB skills have 5 min. to help me with a project.

spyordie007

Diamond Member
I'm exercising my awful VB skills to try and build a little app that will get 2 variables (a username and password) and throw them into 3 commands (that map network drives with the username and password variables). I have a VB project I?ve built in VS.net with the fields/buttons/etc but I cant for the life of me remember (or figure out) how to get the thing to work. Anyone with at least basic VB skills that could both help me with my project and also show me what they did so I can edit it and also do this again on my own next time?

-Spy
 
i have basic vb skills, and just about 5 mins, i'll try to help if i can but i gotta leave for work in 20 mins
 
I imagine you're simply wanting to do a 'net use' with the provided username and password? I don't agree with this solution, but since it's what you requested, do the following:

<codeSnippet language="VB">
Dim sCommand As String
sCommand = "net use drive: \\server\share " & sYourPassword & " /user:" & sYourUsername

Shell sCommand
</codeSnippet>

That's really all you need. Depending on how you want the Shell to execute the command, you may want to tweak the options (to make it minimize so that the command prompt doesn't show, etc.).

Now, a more palatable solution, imo, would be to use the WNetAddConnection2 API call. Here is a decent KB article on how to do this in VB. If you need help with specifics, let me know...
 
One specific I'm unsure about, how to I specify the authentication with the WNetAddConnection2 API call?

I think I can handle creating the app with the instructions available on the KB, and could handle adding the username and password fields to the form, just now how to "make them work".

-Spy
 
Back
Top