Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 207375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:43:48+00:00 2026-05-11T17:43:48+00:00

I am trying to figure out how to accomplish the following task: Create a

  • 0

I am trying to figure out how to accomplish the following task:

  1. Create a network share on a remote
    computer using .NET
  2. The target computer is
    on the same network.
  3. The target computer’s
    admin username and password are
    known.

Your thoughts? How would you go about to accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:43:48+00:00Added an answer on May 11, 2026 at 5:43 pm

    The best and easiest method to do Windows Administrative tasks from code is through WMI. Almost anything can be done on a Windows machine, local or remote, through WMI.

    In order to administer a Windows shared folder you will need to interact with the Win32_Share WMI class.

    Sample on how to use WMI to create a shared folder:

        ManagementPath path = new ManagementPath("Win32_Share");
        path.Server = ".";              // Change this to your server
    
        object[] parameters = new object[] {
            "C:\\TestShare",            // Path to shared folder
            "Test Share",               // Share name
            0x0,                        // Share type (disk drive)
            5,                          // Maximum amount of concurrent users
            null,                       // Password (optional)
            null                        // Security level (optional)
        };
    
        ManagementClass share = new ManagementClass(path);
        object result = share.InvokeMethod("Create", parameters);
    

    You will need to add a reference to the System.Management assembly in order to access the WMI classes. You’ll also need access to the remote machine of course.

    Check out the WMI Reference for more details. Specifically check out the Win32_Share Class reference on what all the parameters and return codes mean.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out the best query to accomplish the following. I have
I am having some trouble trying to figure out, how to accomplish the following.
I'm trying to figure out how to accomplish the following: User can have many
I am trying to figure out how to accomplish the following: Handle client-side click
I'm trying to figure out how best to accomplish drawing a scene in an
Trying to figure out a regex for validating a network path ie: \\comp\xyz or
I am trying to figure out how to create a method that takes a
I am trying to figure out the best way to accomplish this given the
I am trying to figure out the best way to accomplish my problem. I've
Trying to figure out the best way to accomplish this. I have inhereted a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.