Solved

Program to copy files on a network

Posted on 2004-09-07
7
227 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to split this in C++ 4 94
Image decoding from Camera 3 72
simplest php form 3 63
T-SQL:  Sigh---Boy, this is fun.... 12 32
This article will show, step by step, how to integrate R code into a R Sweave document
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

920 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

15 Experts available now in Live!

Get 1:1 Help Now