473,395 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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:Win32_Process")
errReturn = objWMIService.Create _
("cmd.exe /cmd " & strFullPath & "", Null, Null, intProcessID)

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

Set objWMIService = GetObject _
("winmgmts:\\" & strServerName & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
strShareName = strGCN & "$"
errReturn = objNewShare.Create("" & strFullPath & "", "" & strShareName &
"", FILE_SHARE, MAXIMUM_CONNECTIONS, "X Drive")

Cheers,
Liamo

Aug 23 '07 #1
0 1213

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

Similar topics

7
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...
1
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...
6
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. -...
3
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
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
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...
0
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...
0
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...
7
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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...

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.