Help: CMD BatFile Question

Win7User333

New member
Local time
7:51 AM
Messages
1
Hey I have a Question with Windows bat file...

Is there a way to set a if statement for a system error 5

Ex.
Echo off
Title Test
cd/Users
cls
net user /add Frog 123456 (Giving System Error 5 if not ran as admin)
if system error 5 goto error
echo account made
pause
:error
echo ERROR Not Admin
pause

____________________________________________________________________
I typed that quick so their might be bugs... but if someone can help please do...

Thanks
 

My Computer

OS
Windows 7
I think it's just:

IF ERRORLEVEL 5

which would of course be for exit code 5.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Built
OS
Windows 8.1 Pro x64
CPU
Intel Core i7 4790k
Motherboard
MSI Z97S Krait Edition
Memory
8GB Corsair Dominator 1600MHz
Graphics Card(s)
MSI TwinFrozr GeForce GTX770
Sound Card
ASUS Xonar DX/XD 7.1
Monitor(s) Displays
Dell 24" S2409W + Dell 20" E207WFP
Screen Resolution
1920x1080 + 1680x1050
Hard Drives
1x 120GB OCZ Agility 3, 1x 750GB Western Digital Caviar Black, 1x 1TB Western Digital Caviar Blue
PSU
Corsair HX850 modular
Case
Fractal Design Define R4
Cooling
Corsair H60 w/ twin Corsair SP120 fans
Keyboard
Logitech G510S Keyboard
Mouse
Logitech G500S Laser Mouse
Internet Speed
40Mbps
Antivirus
Microsoft Security Essentials
Browser
Google Chrome
Other Info
LG Blu-Ray player
Back
Top