Solved

Program to copy files on a network

Posted on 2004-09-07
7
215 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
Comment Utility
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
Comment Utility
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
Comment Utility
could you test this code:

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

Author Comment

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

Author Comment

by:rwhittle
Comment Utility
Thanks, please close the question
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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…

743 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

18 Experts available now in Live!

Get 1:1 Help Now