473,756 Members | 9,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

map network drive

Hi All
I'm writing scripts in VBS fore years. But now I've to
write a tool in Visual Basic .Net which has to connet to a
Windows domain. I know how to do this in VBS but I don't
find a way in VB.Net. I've no idea how to logon to the
domain via Net.Socket. It is not necessary to map a
network drive. I can transfer data via UNC names.

Can anybody give me a suggestion how to realize it?

Thanks in advance

Alex

Nov 20 '05 #1
4 8783
System.Diagnost ics.Process.Sta rt("Net", "Use N: \\Client1\c$")

HTH
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Alex" <an*******@disc ussions.microso ft.com> wrote in message
news:34******** *************** *****@phx.gbl.. .
Hi All
I'm writing scripts in VBS fore years. But now I've to
write a tool in Visual Basic .Net which has to connet to a
Windows domain. I know how to do this in VBS but I don't
find a way in VB.Net. I've no idea how to logon to the
domain via Net.Socket. It is not necessary to map a
network drive. I can transfer data via UNC names.

Can anybody give me a suggestion how to realize it?

Thanks in advance

Alex

Nov 20 '05 #2
Thanks

Thats great.
But I still have the problem to connect to the Domain with
a different account. Do you have also an idea how to
transfer username and password?

Thanks in advance

Alex
-----Original Message-----
System.Diagnos tics.Process.St art("Net", "Use N: \\Client1 \c$")
HTH
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Alex" <an*******@disc ussions.microso ft.com> wrote in messagenews:34******* *************** ******@phx.gbl. ..
Hi All
I'm writing scripts in VBS fore years. But now I've to
write a tool in Visual Basic .Net which has to connet to a Windows domain. I know how to do this in VBS but I don't
find a way in VB.Net. I've no idea how to logon to the
domain via Net.Socket. It is not necessary to map a
network drive. I can transfer data via UNC names.

Can anybody give me a suggestion how to realize it?

Thanks in advance

Alex

.

Nov 20 '05 #3
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Terry Burns>net help
The syntax of this command is:
NET HELP
command
-or-
NET command /HELP

Commands available are:

NET ACCOUNTS NET HELP NET SHARE
NET COMPUTER NET HELPMSG NET START
NET CONFIG NET LOCALGROUP NET STATISTICS
NET CONFIG SERVER NET NAME NET STOP
NET CONFIG WORKSTATION NET PAUSE NET TIME
NET CONTINUE NET PRINT NET USE
NET FILE NET SEND NET USER
NET GROUP NET SESSION NET VIEW

NET HELP SERVICES lists some of the services you can start.
NET HELP SYNTAX explains how to read NET HELP syntax lines.
NET HELP command | MORE displays Help one screen at a time.

C:\Documents and Settings\Terry Burns>net help us
The syntax of this command is:
NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |
SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]

The keyword NET specifies Windows commands.

NET HELP command | MORE displays Help one screen at a time.

C:\Documents and Settings\Terry Burns>net use /help
The syntax of this command is:
NET USE
[devicename | *] [\\computername\ sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]
NET USE connects a computer to a shared resource or disconnects a
computer from a shared resource. When used without options, it lists
the computer's connections.

devicename Assigns a name to connect to the resource or specifies
the device to be disconnected. There are two kinds of
devicenames: disk drives (D: through Z:) and printers
(LPT1: through LPT3:). Type an asterisk instead of a
specific devicename to assign the next available
devicename.
\\computername Is the name of the computer controlling the shared
resource. If the computername contains blank characters,
enclose the double backslash (\\) and the computername
in quotation marks (" "). The computername may be from
1 to 15 characters long.
\sharename Is the network name of the shared resource.
\volume Specifies a NetWare volume on the server. You must have
Client Services for Netware (Windows Workstations)
or Gateway Service for Netware (Windows Server)
installed and running to connect to NetWare servers.
password Is the password needed to access the shared resource.
* Produces a prompt for the password. The password is
not displayed when you type it at the password prompt.
/USER Specifies a different username with which the connection
is made.
domainname Specifies another domain. If domain is omitted,
the current logged on domain is used.
username Specifies the username with which to logon.
/SMARTCARD Specifies that the connection is to use credentials on
a smart card.
/SAVECRED Specifies that the username and password are to be saved.
This switch is ignored unless the command prompts for
username
and password. This option is not available on Windows XP
Home Edition and will be ignored.
/HOME Connects a user to their home directory.
/DELETE Cancels a network connection and removes the connection
from the list of persistent connections.
/PERSISTENT Controls the use of persistent network connections.
The default is the setting used last.
YES Saves connections as they are made, and restores
them at next logon.
NO Does not save the connection being made or subsequent
connections; existing connections will be restored at
next logon. Use the /DELETE switch to remove
persistent connections.
NET HELP command | MORE displays Help one screen at a time.

C:\Documents and Settings\Terry Burns>

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Alex" <an*******@disc ussions.microso ft.com> wrote in message
news:38******** *************** *****@phx.gbl.. .
Thanks

Thats great.
But I still have the problem to connect to the Domain with
a different account. Do you have also an idea how to
transfer username and password?

Thanks in advance

Alex
-----Original Message-----
System.Diagnos tics.Process.St art("Net", "Use N: \\Client1

\c$")

HTH
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Alex" <an*******@disc ussions.microso ft.com> wrote in

message
news:34******* *************** ******@phx.gbl. ..
Hi All
I'm writing scripts in VBS fore years. But now I've to
write a tool in Visual Basic .Net which has to connet to a Windows domain. I know how to do this in VBS but I don't
find a way in VB.Net. I've no idea how to logon to the
domain via Net.Socket. It is not necessary to map a
network drive. I can transfer data via UNC names.

Can anybody give me a suggestion how to realize it?

Thanks in advance

Alex

.

Nov 20 '05 #4
On Sat, 24 Jul 2004 11:06:45 -0700, "Alex" <an*******@disc ussions.microso ft.com> wrote:

¤ Hi All
¤ I'm writing scripts in VBS fore years. But now I've to
¤ write a tool in Visual Basic .Net which has to connet to a
¤ Windows domain. I know how to do this in VBS but I don't
¤ find a way in VB.Net. I've no idea how to logon to the
¤ domain via Net.Socket. It is not necessary to map a
¤ network drive. I can transfer data via UNC names.
¤
¤ Can anybody give me a suggestion how to realize it?

I would recommend using the API function calls:

http://makeashorterlink.com/?H39D124E8
Paul ~~~ pc******@amerit ech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3654
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore my settings if my profile became tampered with or corrupt. Is there any sample code available out there? -Robert
2
5808
by: giloosh99 | last post by:
Hello, Im grabbing tables via VB code using visual foxpro ODBC drives. The tables directory is in a mapped network drive. The code works fine and does the job, however if the computer is idle for a while the network drive apears to have a red X on the icon and the drive becomes disconnected. this seems to effect the VB code from grabbing the tables. I get an error saying the specific table cannot be found. If i manually open the mapped...
5
21570
by: Niloday | last post by:
Hi All, I am trying to access a mapped network drive from a service that I have created. The service needs to create/delete folders/files on a network drive. When I tried to connect to a folder on mapped network drive (eg. N:\Storage that corresponds to \\FS1NS\SharedDir\), I get an error as "Could not find part of path N:\".
1
6571
by: brian.oneil2 | last post by:
Is there a way to install this onto a network file share and allow a team to access it? I would say share a CD from a networked CD drive, but there are multiple CD's that would have to be inserted. TIA, Brian
8
11853
by: Lam | last post by:
HI anyone knows how can I open a mapped network file in C#? I try string file = @"T:\file.txt"; it shows me the error: "Could not find a part of the path" but if I copy the file to my C dirve, and use @"C:\file.txt"; it worked Thanks a lot
5
4476
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a seperate files server. we have mapped the fodler to a different folder and need to allow the EXE to process on the mapped drive. When I trigger the EXE via web service the EXE get the permission of the launching user (mean ASP.NET user) resulting a...
14
2323
by: frostalicious | last post by:
Used VB.NET (on my client PC) to convert VB6 executable to .NET executable. Placed the .exe file on a network drive on my server. From client, ran .NET Wizards "Trust an Assembly" to make the .exe (on the network drive, on the server) "Full Trust." From the client, double-click on the ..exe (on the network drive, on the server) and it runs fine. So far, so good, but... On the server, where I've installed not VB.NET but .NET
2
2675
by: .Net Believer | last post by:
I using the routine below to copy file to a network drive for a regular backup process. Before calling this routine I using another function to check the presence of the LAN connection and the server where the network drive exists. Although of this check I am sometimes getting an exception (in 5% of times)saying "Could not find the U:\...\File.ext" or part of its path" Although the network dirve is available and accessible by windows...
3
2696
by: Barry Flynn | last post by:
Hi I am working with a VB 2005 program which has been converted from VB6. It writes data out to a flat file, with code like the following line WriteLine(riFileNo, "Hist", lsAssetID, lsRecordType, lsXNbr, lsFiscYr, "Beg", CStr(H.BegBalAccDepn), CStr(H.BegBalCost), CStr(H.BegBalCostReval), CStr(H.BegBalDepCost), CStr(H.BegBalDepnReval)) The program is running from within a Virtual PC
10
11044
by: =?Utf-8?B?Z3JlYXRiYXJyaWVyODY=?= | last post by:
Sorry about that previous one. I pressed enter too early. How does one go about mapping a network drive in C#. i know you use MapNetworkDrive in scripting languages, but i'm not sure how to do it in C#. It doesnt seem like C$ would use MapNetworkDrive.
0
9482
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9292
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10062
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9728
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8733
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7282
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5322
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2694
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.