Solved

Program to copy files on a network

Posted on 2004-09-07
7
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

707 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