Solved

Program to copy files on a network

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

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

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 116
silent install of security banner via msiexec command 4 95
AvlTree-Node Data type 4 14
learn programming 8 42
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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…

832 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