Solved

Program to copy files on a network

Posted on 2004-09-07
7
234 Views
Last Modified: 2010-04-17
I only have a few points but I need your help

I am not a good programmer but I try to help myself.  

I have a problem whereby

I logon to a windows 2000 professional machine and try to map a network drive so that each student can copy their own disk.

I use Visual Basic 6.0

I want the program to
1.  Ask for the username
2.  Ask for their password
3.  Map to the network drive

example
username: andrew
password: ********
"command to map network drive"
net use g: \\domainname\username$ /user:domainname\username password


I hope I give you enough info.  Thanks for your response. Ray

0
Comment
Question by:rwhittle
  • 3
7 Comments
 
LVL 3

Expert Comment

by:Belthazor
ID: 12006215
Hi, i'm not sure about what you are trying to do. Do you want to have a GUI for the net use command?
If so, that's what i've been doing in VB6:

1. Place a TextBox named User and one named Password on your form.
2. Place a Button named NetUseNow on your form.
3. Let your Programm execute this code:

Private Sub NetUseNow_Click()
 strCommand = "net use i: \\domainname\" & User.Text & "$ " & Password.Text & " /USER:domainname\" & User.Text
 s = Shell(strCommand)
End Sub

hope it helps
Belthazor
0
 

Author Comment

by:rwhittle
ID: 12007352
Private Sub Close_Click()
Shell Environ("ComSpec") & " /c net use g: /del"
End Sub

Private Sub Command1_Click()
Dim username As String
username = Text1.Text
Shell Environ("ComSpec") & " /c net use i: /del"
Shell Environ("ComSpec") & " /c net use i: \\csa\" & Trim$(username) & "$" & " " & "/user:csa\" & Trim$(username)
End Sub

Private Sub Command2_Click()
Shell Environ("ComSpec") & " /c explorer i:"
Text1.Text = " "
End Sub


This is the code,  the user types in their username, then there is a pasword button, when they click on the password button the command net use \\domain .... will run from the command prompt window. After the type in the password, they then click on the copy button and the explorer command will execute.

The problem I am having is when they click on the password  button the dos command window is minimized, therefore the user will not know that the window to type in their password is actually minimized.  Could  you say what I could do to make the dos window maximized when they click on password?   Thanks for your help Ray.
0
 
LVL 5

Accepted Solution

by:
tzxie2000 earned 70 total points
ID: 12016120
could you test this code:

Shell(Environ("ComSpec")&"net .......", AppWinStyle.MaximizedFocus)
0
 

Author Comment

by:rwhittle
ID: 12134327
Shell Environ("ComSpec") & " /c net ......." ), vbMaximizedFocus
This works thanks a lot
0
 

Author Comment

by:rwhittle
ID: 12358231
Thanks, please close the question
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Report events not being triggered 8 120
strDist challenge 35 103
groovy example issue 10 97
some keys in my laptop is not working. any suggestion 6 25
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
A short article about problems I had with the new location API and permissions in Marshmallow
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now