473,467 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using "net use" in Console application

SF
How can I call a "net use" command from within my application? I need
to dynamically connect to some remote shares.

Thanks,

Matt
May 22 '06 #1
3 8105
I think it is better to write batch file like

net use %1 %2
where %x are parameters

------

in .NET you can start it using Process.Start("net use ....")

I hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

May 22 '06 #2
MGH
Galcho[MCSD.NET] wrote:
I think it is better to write batch file like

net use %1 %2
where %x are parameters

------

in .NET you can start it using Process.Start("net use ....")

I hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

Can someone point me in the direction of a example of using a batchfile
with parameters?
May 22 '06 #3
create file "map.cmd" that contain this:
"net use %1 %2"
without quotes

now you can use it like this

map z: \\server1\share1
map y: \\server1\share2

this is suitable if parameters are frequiently changed. as you can see
this is not very different than usent net use itself
-------------------------
example two:
create single batch file mapAll.cmd that contains
net use z: \\server1\share1
net use y: \\server1\share2

this is most suitable if you do not change letters or network shares

I hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

May 22 '06 #4

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

Similar topics

0
by: vani | last post by:
HI All, I need to register the assembly in GAC. I have created a assembly in .Net for toolbar creation. When we manually install the assembly in GAC there are two entries getting added in the...
2
by: Kishore | last post by:
Hi, I have a small console application written in c# that takes two arguments. I am using System.Diagnostics.Process.Start("cmdApp.exe", arguments) to start the application from another .net...
4
by: Ioannis Vranos | last post by:
Will "STL .NET" of VS 2005 include a fully managed std::string? -- Ioannis Vranos
0
by: VSS | last post by:
Some of my sps are showing high reads if executed from a >net application. Like if sp is executed from .net app it shows some wayy around 5000000 reads and does not complete even in 10 min. Same...
6
by: tony | last post by:
Hello! When you have windows forms you have the same possibility as when you have a Console application to use Console.Writeln to write whatever on the screen. Now to my question: Is it...
6
by: =?Utf-8?B?U2FtZWVrc2hh?= | last post by:
Hi, I want to write a simple .net program to open a URL, fill in fields, and click on a button to submit it using .net 1.1 framework. Can someone help in suggesting the libraries I should use?...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
1
by: M Harris | last post by:
I have a production database that is password protected. Through my application, I want to provide the users with a COPY of this database, including RI, without a password or at least a different...
1
by: vkohli | last post by:
Is it possible to pass DDE requests using .net application language ? We are using a phone system that passes DDE variables. We need to pass the variable to a .net development application.
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.