Link to home
Start Free TrialLog in
Avatar of maurice cristen
maurice cristen

asked on

batch to create new folder path

i need a batch file to create this path: C:\Windows\winwin123
this path already exist: C:\Windows\  but the folder called  ''winwin123 '' must be created ,afetr is created i want to go there: C:\Windows\winwin123
SOLUTION
Avatar of Francois Peroux
Francois Peroux
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maurice cristen
maurice cristen

ASKER

this run perfect:
mkdir C:\Windows\winwin123 
timeout /t 3
explorer C:\Windows\winwin123

Open in new window


only if i right click and run as administrator,can someone add a code with administrator rights?to do that automatically
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use Powershell Script and add this line first:
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }

Add your script after this line. The elevation will be done automatically.

Let me know !
some windows dones't have powershell
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial