473,587 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating remote shares using vb.net

Folks,

I don't think came across this situation before but I cannot get any answers
or direction on what I thought loads of people would have try. A wee bit of
history, I have application in Access using VBA code to do loads of stuff for
creating user accounts which works great, but now I'm in the process of
changing into vb.net environment and getting most of the functionally to work
as my access application, one of the automated tasks my access application
does is create home directories on remote file server and set share
permission on that server for each new user, I use WMI scripting within my
access application. However, I cannot get the same code to work in vb.net
environment and I cannot find resources on how to do this in vb.net. Has
anyone any suggesting or is it a case I just go back to Access.....

Sample of WMI code that works, can

et objWMIService = GetObject _
("winmgmts:\ \" & strServerName & "\root\cimv2:Wi n32_Process")
errReturn = objWMIService.C reate _
("cmd.exe /cmd " & strFullPath & "", Null, Null, intProcessID)

' setting the sharing of a folder
Const FILE_SHARE = 0
Const MAXIMUM_CONNECT IONS = 25

Set objWMIService = GetObject _
("winmgmts:\ \" & strServerName & "\root\cimv 2")
Set objNewShare = objWMIService.G et("Win32_Share ")
strShareName = strGCN & "$"
errReturn = objNewShare.Cre ate("" & strFullPath & "", "" & strShareName &
"", FILE_SHARE, MAXIMUM_CONNECT IONS, "X Drive")

Cheers,
Liamo

Aug 23 '07 #1
0 1229

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

Similar topics

7
2668
by: Dan V. | last post by:
Situation: I have to connect with my Windows 2000 server using VS.NET 2003 and C# and connect to a remote Linux server at another company's office and query their XML file. Their file may be updated every hour or so. How can I do this easily? I would like to use secure communication even encryption if possible. I would query and insert...
1
2605
by: Dan King | last post by:
I have a few ASP pages that run great on a local machine. They read folder content then display the information in the browser. I would like to be able to read the same data from several remote servers. The problem is the remote servers are all in different domains with no trusts between them, so I cannot run the site as a domain user. I...
6
14840
by: Jeff | last post by:
Hi - I understand how to create a directory folder, but how can I programatically create a _shared_ directory folder and set its permissions?? (I'm using VB.NET.) Thanks for your help. - Jeff
3
1850
by: Terry Olsen | last post by:
How can I add a remote printer to my local pc? And then set it as the default? Thanks. *** Sent via Developersdex http://www.developersdex.com ***
2
1034
by: Joseph Gruber | last post by:
I'm trying to create in my app the ability to view the folder/file structure of a remote server. Does anyone have any suggestions for this? Or if there is a control that will do so?
0
1385
by: trazcure | last post by:
Hi everyone, my name is Traz I'm trying to write some C# code that will check for remote disk space on network shares. I have seen across the internet and MSDN that you can utilize the System.Management class and it's methods to perform this operation. I have been able to check a variety of computers disk space successfully but not local...
0
2117
by: =?Utf-8?B?TGlhbSBNYWM=?= | last post by:
Hi Folks, I have embeded WMI scripting within a Visual Basic application to create remote shares and set permissions, I'm now moving to vb.net environment and having trouble getting my scripting to work, I have search the net for vb.net code to create shared folders and set permsission but no joy, if anyone can help or recommend good web...
0
858
by: Barkingmadscot | last post by:
Hi I have setup DFS namespaces (no problem here). I am currently writing software to manage their projects. The DFS is \ \%domainname%\projects\%year%\ProjectNo we have different remote sites dealing with different projects, so have i setup the DFS root at the ProjectNo, so that i can sync/move projects to different server without...
7
4160
by: luker | last post by:
Hello Experts, I am writing an application for a device running windows xp embedded. I want to code on my developer pc and deploy the running executable to the embedded device. - The two boxes are linked directly by a network cable. - Both are in the same subnetwork and are able to ping each other. - Each box is sharing a directory. -...
0
7920
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...
0
8347
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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...
1
5718
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...
0
5394
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...
0
3844
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.