Skip to content

Instantly share code, notes, and snippets.

@alastairtree
Created December 14, 2015 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alastairtree/122ff1f6bfc480cfbd6b to your computer and use it in GitHub Desktop.
Save alastairtree/122ff1f6bfc480cfbd6b to your computer and use it in GitHub Desktop.
cmd.exe/psexec.exe oneliner to create a folder and share it
REM Will create c:\Deploy, share as "\\server\Deploy"
REM and grant change permissions to administrators and users
cmd /c "(C: & (mkdir C:\Deploy 2> NUL)) & (net share Deploy=C:\Deploy /grant:"Users",CHANGE /grant:Administrators,CHANGE 2> NUL)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment