Bat script to share a folder

I'm trying to share a folder using a bat script
I'm trying something like this, but it doesn't work 
NET SHARE test=P:<folderLocation> /GRANT:domain\username,FULL
it's giving me system error 5 - access is denied even tho I'm the domain admin :S 

Hi,
If you want to create a share folder via script, I suggest we tried to refer to the following articles.
Create a Shared Folder and Assign Share Permissions
http://gallery.technet.microsoft.com/ScriptCenter/6309d93b-fcc3-4586-b102-a71415244712/
Create a Shared Folder
http://gallery.technet.microsoft.com/scriptcenter/d654b1ff-1091-4173-affd-67d5d09b0923
If you have some trouble in editing the script, I suggest we could ask in the script forum.
The Official Scripting Guys Forum!
http://social.technet.microsoft.com/Forums/en/ITCG/threads/
Regards,
Andy

Similar Messages

  • How can I share a folder between two users on the same mac?

    Hi all,
    I would like to share a folder between multiple users on the same macbook without having to transfer the folder to the Public/Shared folder.
    Is there not a way, using the the folders shared permissions, to allow shared folders from one user to be visible and usable by another user on the same mac without having to move the folder to a designated shared location?
    Regards,
    Caleb

    jrwood116 wrote:
    Thanks, but do you have to do that every time you share a folder?
    No, you just need to do it once and that's it. Anything that is in the Shared folder is accessible by all user accounts within the same Mac.
    jrwood116 wrote:
    I've read numerous 'how to share a folder' blogs and they just say it's as simple as clicking 'share' and allowing specific users to access it...none have mentioned this (not saying your advice is wrong at all, just don't get why no-one else has mentioned what appears to be a key step!)
    Can you give me an example of such a blog. I suspect you may have mis-understood what they were saying but if you can provide a link, I'll look at it.

  • How can I share a folder between two users on the same iMac?

    I have an iMac with 2 user accounts and I want to share a folder between them. I have gone on to system preferences>sharing and turned on file sharing. I have also got the 'Get Info' thing up, selected 'Shared Folder' and added the other user to the read and write permissions...it just doesn't show up on the other desktop (the folder is on my desktop, I would have expected to see it on the other desktop...?)
    Any ideas?

    jrwood116 wrote:
    Thanks, but do you have to do that every time you share a folder?
    No, you just need to do it once and that's it. Anything that is in the Shared folder is accessible by all user accounts within the same Mac.
    jrwood116 wrote:
    I've read numerous 'how to share a folder' blogs and they just say it's as simple as clicking 'share' and allowing specific users to access it...none have mentioned this (not saying your advice is wrong at all, just don't get why no-one else has mentioned what appears to be a key step!)
    Can you give me an example of such a blog. I suspect you may have mis-understood what they were saying but if you can provide a link, I'll look at it.

  • Unable to share a folder with specific users

    Hi,
    I'm attempting a seemingly simple task on my home network of 4 computers. I want to share a folder located on one computer, called PC1, with another computer called PC2 with full read/write permission. All other machines on the network are not to have access
    to this folder. Both machines are running Windows 7.
    On PC2, I am able to see the shared folder under Networks but if I try to open it, I keep getting a 'You do not have permission to access...' error. The following are the steps I've taken to set up the network share.
    Both machines are on the same workgroup.
    Both machines are on the home network, not work/public.
    Turned off homegroup on both machines in Advanced Networking Properties by selecting "Use user accounts and passwords to connect to other computers".
    Created a standard non-admin user account on PC1 that has the same username/password as the admin login used to log into PC2.
    On PC1, right-clicked the folder I want to share and added the above user account to both the Sharing and Security tabs.
    Removed the Everyone group in PC1 from both the Sharing and Security tab for the shared folder.
    If I am missing a step, please let me know. I have noticed that if I add  the Everyone group back to the Sharing and Security tab for the shared folder on PC1, I am able to have full access from PC2. However, since I want to restrict access
    to this folder to only one machine, I didn't want to have the Everyone group listed.

    As this thread has been quiet for a while, we assume that the issue has been resolved. At this time, we will mark it as ‘Answered’ as the previous steps should be helpful for many similar scenarios.
     If the issue still persists and you want to return to this question, please reply this post directly so we will be notified to follow it up. You can also choose to unmark the answer as you wish.
     In addition, we’d love to hear your feedback about the solution. By sharing your experience you can help other community members facing similar problems.
     Thanks!
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • How do I share a folder on mac mini with other macs in the network?

    Howdy all!
    The scenario I have in mind is that I have one folder in our Mac Mini (used as Home Theater) with all the family's music files on it. The rest of the family would be able to access the folder and copy the music they prefer onto their own computers (iMacs and Macbooks). The other computers would have read only access, they would not be able to alter the contents of the original file (to prevent accidental deletion). Only the user of the Mini Home Theater could alter the contents of said file.
    I have tried pulling up the "Get Info" window and clicking the "Shared Folder" and "Locked" boxes, but all this seems to do is make the user of the Mac Mini unable to alter the contents of the folder. All the other macs on the network can access and alter the folder contents no problem.
    What am I missing?
    Thank you for any advice you can give!

    This isn't quite what I was looking for. I don't want to share the folder with users on the same computer--I want to share the folder with users on other computers.
    Unless there is some way to identify users on other computers. How can I do that?

  • How to share a folder with ipad or iphone trough win7 ?

    Good day, please help to know,How to share a folder with ipad or iphone trough win7 ?  I have two PC ( win 7) and work with iPad and iPhone at the same time and always  i need to transfer file or documents to iPad (iPhone ) and also transfer from iPad( iPhone) to PC(win7) , already i have used some share wifi app that have to used ip address like 192.168.5.2:8888 that i am not really like this way actually i need a way or app to share a folder from my PC to iPad and iPhone.
    And also how can i look my iphone or ipad in network of PC?
    Many thanks

    I know of apps that can access shares and download but I am not aware of any apps that will allow you to upload as well.

  • Distribution manager failed to create the defined share or folder on distribution point and failed to connect to remote distribution point

    We have recently upgraded remote distribution point to SCCM 2012 R2 CU4. when i try to distribute the package getting the error on the distribution point configuration status "Distribution manager failed to create the defined share or folder on distribution
    point and failed to connect to remote distribution point"
    Errors on the package transfer log file.
    CWmi::Connect() could not connect to \\XXXXXXXX.COM\root\SCCMDP. error = The operation completed successfully.. Will try FQDN
    CWmi::Connect() failed to connect to \\XXXXXXX.COM\root\SCCMDP. error = The RPC server is unavailable.
    Failed to connect to the DP WMI namespace on the remote DP

    Thanks Sandys for your suggestions.
    i have tried wbemtest from site server(Secondary site) and remote DP server. Receiving the "The RPC
    server is unavailable" from both ends.
    error:0x800706ba - The RPC server is unavailable

  • How do I share a folder permanently to guest user - no internet connection

    Hi, sorry but ive tried looking everywhere and cannot find the answer.
    Im the main user and admin of my macbook pro, I have also set up a guest account so any user can login with no password and use the computer.
    However, I would like to permanently share 1 folder I have with movies and pictures with the guest account.
    I know I can enable folder sharing through the internet, but I dont want that, I all I want is to allow access to one of my folders and make it visible to the guest account.
    Is this possible or do you have any suggestions?
    Thanks!

    Hi Clinton thanks for your answer.. But it does not work for me. I put the folder under: Users > Shared Folder
    and I still cant see it when I log in to the guest session.
    I attached 2 screenshots.. Screen 1 shows how I placed the folder "movies" in the shared folder on my main account and Screen 2 shows you what I see when I log in as Guest.
    Please let me know if Im doing something wrong,
    Thanks,
    Screen 1
    Screen 2

  • Cannot launch vivado simulator 2015.1: behav/compile.bat' script "Please check that the file has the correct 'read/write/execute' permissions"

    Hi,
    I'm trying to run a verilog simulation using the vivado simulator 2015.1 on Windows 7.
    I get the following error when I attempt to launch simulation:    
    ERROR: [USF-XSim-62] 'compile' step failed with error(s) while executing 'D:/projects/axi/axi_test_system/axi_test_system.sim/sim_1/behav/compile.bat' script. Please check that the file has the correct 'read/write/execute' permissions and the Tcl console output for any other possible errors or warnings.
    The tcl console repeats the same message, "Please check that the file has the correct 'read/write/execute' permissions"
    I cannot find any problem with the permissions.  I believe that windows will always execute a .bat file.   Within the same project, I can run elaboration, synthesis and implementation without problems. 
    Any idea why the simulation compile script won't run?
    Thanks,
    Ed

    Hi,
    Thanks very much for your detailed reply. These were the right questions based upon what I told you.   
    However, I took the code home last night and ran it on my webpack 2014.2 release.   It still failed, but I got completely different error messages.   These messages correctly pointed me to an undeclared signal in my testbench. Once fixed, the compile worked and the simulator launched. 
    This morning, I fixed the signal name in my 2015.1 setup, and it also compiled and launched correctly. 
    So, the problem wasn't actually related to file permissions.  It seems like the 2015.1 error message may be broken compared to 2014.2.  
    I was running the Vivado GUI, clicking on "Simulate > Run Behavioral Simulation"
    Thanks again for your help. 
    Regards,
    Ed  
      

  • Saving CSV file on Share Point folder

    Hi,
    When trying to save a project map to a csv file on a Share Point folder we got this error:
    "Project does not support resource pooling on a web server".
    can anyone help me with this?
    thanks,
    Yuval

    Hi Yuval,
    Please refer to this link:
    http://support.microsoft.com/kb/242627/en-us
    The cause is that you are sharing in your file resources from another project, or using a shared resource pool file.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • Command to share a folder with hyphens

    I need to share a folder via cmd for use in a batch file hence the %computername% part. The file is %computername%-scan and is located in the root of c drive and will be shared with a share name of %computername% where %computername% is the pc's hostname to
    a local user which i used in administrator mode.
    net share %computername%=c:\"%computername%-scan" /GRANT:scan,CHANGE
    I used the above command to share it but it is not successful. However, if i remove the -scan from the filename and the command with the quote marks,the sharing works. Is there a special option for sharing a folder with symbols and characters?

    Hello,
    Try this this will work....
    net share %computerName%=C:\%computerName%-Scan /GRANT:UserName,CHANGE
    pause
    Abhinav

  • Need a bat script to check Server status remotly.

    Hi,
    I need bat script to check server status remotly (Ping) for multiple servers. It should generate a txt file for result.
    Thanks.

    Hi Ravi,
    To ping multiple computers and generate report cia cmd, please refer to the script below, the "fnm" is computer name list and the "lnm" is the result, and you can save the script below as .bat file:
    @echo off
    set fnm=d:\test1\computers.txt
    set lnm=d:\test1\ping.txt
    if exist %fnm% goto Label1
    echo.
    echo Cannot find %fnm%
    echo.
    Pause
    goto :eof
    :Label1
    echo PingTest STARTED on %date% at %time% > %lnm%
    echo ================================================= >> %lnm%
    echo.
    for /f %%i in (%fnm%) do call :Sub %%i
    echo.
    echo ================================================= >> %lnm%
    echo PingTest ENDED on %date% at %time% >> %lnm%
    echo ... now exiting
    goto :eof
    :Sub
    echo Testing %1
    set state=alive
    ping -n 1 %1
    if errorlevel 1 set state=dead
    echo %1 is %state% >> %lnm%
    Refer to:
    Explain the Batch script to ping multiple computers
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How do I share one folder on iCloud Drive

    Me and my wife have different AppleID. We are going paperless and want to share one folder either on my or her iCloud Drive.
    Using a mutual Dropbox account today but want to be inside Apples ECO-system.
    Called Apple and they told me not possible. Are they correct?

    AsI said - you have to open the application folders and delete the documents  inside - for each folder separately. And wait for these changes to sync.
    The folders themselves cannot be deleted, only their content.
    The iCloud setting for the applications are device specific. If you enabled an app for iCloud on any device, you will see the application collection in iCloud, even if you disable it on other devices.
    If one disables the apps in the iCoud System Preferences, their folders disappear in the finder but are still in the cloud -- and there is a big pile of other garbage.
    First delete the documents in the folders, until they are empty on iCloud, then hide the folders on your devices by disabling the app in the "Manage my storage" iCloud preferences.
    I want to reliably delete ALL data (including any folders or metadata Apple lets us not see) -- a complete reset for iCloud Drive
    You can only delete documents you move to iCloud drive, not Apple's maintenance files.
    And you can only reset each device individually, that is using iCloud Drive, by disabling iCloud Drive, rebooting, signing in again. But you cannot reset the central storage in iCloud.
    - and there is a big pile of other garbage.
    What kind of other garbage, beside the application collections?

  • How do I share a folder over the internet with Mountain Lion server?

    I am new to using formal servers.  In Snow Leopard I was able to use web sharing to serve a small website and if I wanted to share a folder with someone I would  just provide the person I wanted to share a file with the path to the file inside the sites directory.  With Mountain Lion this functionality was removed from the sharing section of system preferences.
    I purchased mountain lion server and was able to restore the website serving ability, but I haven't been able to figure out how to share a folder.  I am still looking over what documentation I can find, but for the most part it just tells me to set up the services without telling me how.  Any assistance would be helpful.  Networking is not my area of expertise.
    Best Regards,
    David Finell

    I purchased server to assist with this as I am unfamiliar with the command line protocols for using apache.  Because of the UNIX architechture of OSX and I presume apache, I am uncomfortable using the command line for fear of causing serious problems.
    Unfortunately, the documentation that I have seen for mountain lion server is wanting in either its completeness or layout/functionability.  To summarize the server instructions as I understand them.  It just says to configure it and my system to meet my requirements without telling me how.
    I am confident that both the apache command line and server are capable of accomplishing what I was able to do before under snow leopard.  I just haven't figured out how.
    I was able to provide a link to family and clients like http://ipaddress/~user/folder
    This no longer works.

  • I want to share a folder of images with a client who is also using bridge. I want the client to be able to edit metadata and rate the image. How can I do this?

    I want to share a folder of images with a client who is also using bridge. I want the client to be able to edit metadata and rate the image. How can I do this?

    Metadata won't be a problem as long as you use Bridge to copy the file from within Bridge to whatever media (flash drive, CD/DVD. email, etc) you plan to use for the sharing.
    I'm not sure about the Label part.  Maybe it will travel along too.

Maybe you are looking for

  • Custom Calculation Script Question

    I'm flying blind here, I know nothing about this stuff. I just need something i can copy and paste into the "custom calculation script" box. I'm working on making a character sheet for star wars saga edition auto calculate. The only thing I have left

  • Sql select query problem

    hi friends, i've a view called "risk_efforts" with fields user_id,user_name,wknd_dt,week_day,prod_efforts,unprod_efforts. Name Type ROW_ID NUMBER USER_ID VARCHAR2(14) USER_NAME VARCHAR2(50) WKND_DT VARCHAR2(8) WEEK_DAY VARCHAR2(250) PROD_EFFORTS NUMB

  • Focus on JTextfield in JDialog box

    A JDialog box is being opened from a menu. There is only one JTextfield on the dialog box and 2 buttons. The focus is not on any of the components in the dialog box and I want it on the textfield by default. I have tried all the requestFocus(),reques

  • LR and ARC 4.4

    How do you install ARC 4.4 into LR 1.3.1? Thanks, Bruce

  • T43 CD/DVD ISSUES

    Ok this may be a small issue for someone - I'm hoping anyway. I recently removed my CDRW/DVD drive which would no longer write data and replaced it with a DVD-Multi drive from a T60 series. Now the T43 wont recognize the drive. It sees it as a straig