Windows 10: Need to create batch file for "net share" command

Discus and support Need to create batch file for "net share" command in Windows 10 Network and Sharing to solve the problem; I created a simple command from powershell that maps a drive for me using the "net share" command (see below). However, i want to turn this in to a... Discussion in 'Windows 10 Network and Sharing' started by eeps24, Feb 2, 2018.

  1. eeps24 Win User

    Need to create batch file for "net share" command


    I created a simple command from powershell that maps a drive for me using the "net share" command (see below). However, i want to turn this in to a batch file so I do not have to type it every time. When I name it filename.bat and try to run it, I get a

    system error 5 has occured, access denied

    I assume I have to make this a powershell script. My question is, if I cant run it as a batch file, how do I run this as a powershell script so I only have to click on it to run it?

    *I am extremely new to powershell

    Thank you

    net share myshare=z:\ /grant:user,full /users:1

    :)
     
    eeps24, Feb 2, 2018
    #1

  2. Lost my Microsoft Edge on Start up and Task Bar.

    You need to use snippingtool.exe to create a snapshot of the screen that shows this message. When you attach the snapshot to your reply then I can tell you what went wrong.
     
    Frederik Long, Feb 2, 2018
    #2
  3. Computer won't wake from sleep mode (Windows 10)

    ccleaner.. you must be kidding me.
     
    Kim Lattimer, Feb 2, 2018
    #3
  4. Need to create batch file for "net share" command

    You have to run that command with Administrator privileges. Right-click the batch file and click Run as administrator.
     
    PolarNettles, Feb 2, 2018
    #4
  5. You are not mapping a drive you are configuring share options for Z: drive.

    Mapping a drive to a network share assigns that share a drive letter so that it’s easier to work with.

    To map a network drive, type the following command and then hit Enter:
    Code: net use x: \\computer name\sharename /user username password [/quote]
    In order to make the connection to the shared folder permanent, you need to add the /P parameter. This will ensure the drive will remain even after a restart. In some versions of Windows, you may have to use /PERSISTENT instead of /P. Code: net use x: \\computer name\sharename /P:Yes [/quote] You can delete a mapped network drive using the command prompt by typing in the command below.

    Code: net use x: /delete[/quote] To delete all mapped network drives by executing below command.

    Code: net use * /delete[/quote]
     
    FreeBooter, Apr 5, 2018
    #5
Thema:

Need to create batch file for "net share" command

Loading...
  1. Need to create batch file for "net share" command - Similar Threads - Need create batch

  2. Batch File Command???

    in Windows 10 Gaming
    Batch File Command???: I want to run a batch file that starts a backup program, but does not execute the next command until that program completes? How do I do this? https://answers.microsoft.com/en-us/windows/forum/all/batch-file-command/3af2ce6b-ace3-43cb-b6fb-5cbff8998736
  3. Batch File Command???

    in Windows 10 Software and Apps
    Batch File Command???: I want to run a batch file that starts a backup program, but does not execute the next command until that program completes? How do I do this? https://answers.microsoft.com/en-us/windows/forum/all/batch-file-command/3af2ce6b-ace3-43cb-b6fb-5cbff8998736
  4. Creating batch file on Win10

    in Windows 10 Network and Sharing
    Creating batch file on Win10: Hey, this is someone's previous answer of creating a bat file but it only works if you dont change the file name first to "*.bat" before you open the file:Open the fileClick Save AsSelect the desired locationIn the File name field, type Whatever.batIn the Type field, select...
  5. Creating batch file on Win10

    in Windows 10 Software and Apps
    Creating batch file on Win10: Hey, this is someone's previous answer of creating a bat file but it only works if you dont change the file name first to "*.bat" before you open the file:Open the fileClick Save AsSelect the desired locationIn the File name field, type Whatever.batIn the Type field, select...
  6. Need help to create a batch file

    in Windows 10 Support
    Need help to create a batch file: Hi Folks, I need to create a batch file that automatically takes permissions & delete the following file & folders File:- C:\Windows\System32\SecurityHealthSystray.exe Folders:-...
  7. Command Prompt/ Batch files

    in Windows 10 Ask Insider
    Command Prompt/ Batch files: [ATTACH] when i create a batch file to ping something, it spams the command and throws no response. how do i fix this? https://preview.redd.it/fyy6qwrfx7n61.png?width=256&format=png&auto=webp&s=d55552fdc7a5c297d565617f710992048238660c submitted by /u/xWasss [link]...
  8. Create batch files with Batch?

    in Windows 10 Software and Apps
    Create batch files with Batch?: How to create Batch and VBS files with Batch? So I write a batch file which I then convert to exe that creates new folders in a certain directory and then creates batch and VBS files with a certain content and saves them in the created folder. So it's similar to a program...
  9. net share command

    in Windows 10 Network and Sharing
    net share command: Running Windows 10: when I ran net share to look at any shared folders, the result was as follows. what does this mean that I have a remote IPC and remote Admin? How did this get setup. I do not want to share any files. could have happened if I tried to set up Cloud...
  10. Create Multipurpose batch file

    in Windows 10 Software and Apps
    Create Multipurpose batch file: Hope this is the correct sub forum for this.. Often use a variety of command line functions e.g. winver / netplwiz etc etc Is there a way of creating a batchfile to include multiple commands with a number option to select...would be so handy i.e. 1 Netplwiz 2 Winver...