I created this script just to make my life a little bit easier.
Either run this script as administrator or create a shortcut to this script, set it to run as admin.
echo Administrative permissions required. Detecting permissions…
net session >nul 2>&1
if %errorLevel% == 0 (
echo Success: Administrative permissions confirmed.
) else (
echo Failure: Current permissions inadequate. Please run as administrator. Recommend creating shortcut and setting it to run as admin.
echo Folder Share Script
set /p arpath=Copy folder path into this window and press enter:
for %%A in (%arpath%) do set filename=%%~nxA
net share “%filename%”=”%arpath%” /GRANT:EVERYONE,FULL /CACHE:NONE
echo Folder shared successfully. Press any key to exit
pause > nul