Net Use Error Level
Contents |
activation email? 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length Forum only search News: Home Help Login Register Computer Hope » Microsoft » Microsoft DOS » Batch File error handling using net use errorlevel codes Net Use « previous next » Print Pages: [1] Go Down Author Topic: Batch
Net Use Errorlevel List
File error handling using Net Use (Read 12571 times) 0 Members and 1 Guest are viewing this topic. getintanked Guest Batch net use error 53 File error handling using Net Use « on: August 17, 2007, 05:25:36 PM » I am creating a batch file that allows users to re-map their Home network share drive after a vpn connection has been
Net Use Error 67
made. Since the mapping is based on their profile, this won't push unless they logon while connected to our network.We have many offsite locations so, I made it so they have to choose their location and it will map based on their local domain controller.However, when using NET USE there are a few instances when errors can occur (always user error...)For example. If they haven't vpn'd in yet, its going to throw net use error codes an error stating that the network path cannot be found - I want to catch this error and replace it with something like "make sure you have a live internet connection and you can reach the intranet home page first, and try again"Same goes for if they are allready mapped and they are running the batch file again, it will say something about the drive letter is already in use... and i would like to replace that error with "Your drive is already mapped, open your my computer and access your H:/ Drive"Code: [Select]title ~ AVI Information Technology ~ Map My Home Drive
@ECHO OFF
CLS
ECHO ------------------------------
ECHO Name of the Company
ECHO ------------------------------
ECHO Please select your home office location...
:LOOP
ECHO A. Altamonte
ECHO B. Atlanta
ECHO C. Cleveland
ECHO D. Columbia
ECHO E. Cypress
ECHO F. Dallas
ECHO G. Denver
ECHO H. Detroit
ECHO I. Ft. Lauderdale
ECHO J. Jacksonville
ECHO K. Lanham
ECHO L. Las Vegas
ECHO M. Nashville
ECHO N. New York
ECHO O. Orlando
ECHO P. Pittsburgh
ECHO Q. Salt Lake City
ECHO R. Tampa
ECHO Z. Quit
SET Choice=
SET /P Choice=Type the letter and press Enter:
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
:: /I makes the IF comparison case-insensitive
I
Microsoft Tech Companion App Microsoft Technical Communities Microsoft Virtual Academy Script Center Server and Tools Blogs
Net Use Command
TechNet Blogs TechNet Flash Newsletter TechNet Gallery TechNet Library
Net Use Delete
TechNet Magazine TechNet Subscriptions TechNet Video TechNet Wiki Windows Sysinternals Virtual Labs Solutions Networking Cloud net use map drive and Datacenter Security Virtualization Downloads Updates Service Packs Security Bulletins Windows Update Trials Windows Server 2016 System Center 2016 Windows 10 Enterprise SQL Server http://www.computerhope.com/forum/index.php?topic=40902.0 2016 See all trials » Related Sites Microsoft Download Center TechNet Evaluation Center Drivers Windows Sysinternals TechNet Gallery Training Training Expert-led, virtual classes Training Catalog Class Locator Microsoft Virtual Academy Free Windows Server 2012 courses Free Windows 8 courses SQL Server training Microsoft Official Courses On-Demand Certifications Certification overview https://technet.microsoft.com/en-us/library/cc940100.aspx MCSA: Windows 10 Windows Server Certification (MCSE) Private Cloud Certification (MCSE) SQL Server Certification (MCSE) Other resources TechNet Events Second shot for certification Born To Learn blog Find technical communities in your area Support Support options For business For developers For IT professionals For technical support Support offerings More support Microsoft Premier Online TechNet Forums MSDN Forums Security Bulletins & Advisories Not an IT pro? Microsoft Customer Support Microsoft Community Forums United States (English) Sign in Home Library Wiki Learn Gallery Downloads Support Forums Blogs We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Windows 2000 TCP/IP TCP/IP Troubleshooting Unable to Reach a Host or NetBIOS Name Unable to Reach a Host or NetBIOS Name Error 53 Error 53 Error 53 Error 53 Cannot Connect to Remote Systems Using Host Name TOC Collapse the table of content Ex
(עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsRepositoryCommunityForumsBlog Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: Bat - errorlevel on net https://social.technet.microsoft.com/Forums/scriptcenter/en-US/1e25aad3-d960-4445-9e2e-2d87c4b661eb/bat-errorlevel-on-net-use-command?forum=ITCG use command Scripting > The Official Scripting Guys Forum! Question 0 Sign in to vote I am running a batch file from a web page. The http://arstechnica.com/civis/viewtopic.php?f=17&t=760266 batch works fine first time and even more than once. But every so often the net use command stops working.It is a simple net use command, I net use delete all before running it i.e net use * /delete /yes. But it won't map and returns errorlevel 2. net help refers to errorlevel 2 as "The system cannot find the file specified." which seems very strange?!!What is weird is that I am mapping 2 drives and the second is always fine. I can net use error connect and disconnect that all day long.Once the drive is not connecting I can not see what makes it work again. After a while it starts to work with no intervention from me. Any ideas? Thursday, December 17, 2009 1:36 PM Reply | Quote Answers 0 Sign in to vote Drives are a strange thing. I had a similar issue today. A user called me over, all her drives giving the unavailable popup when you click on them. All execpt the home area. I logged the user off and on again, checked the TCPIP, then after a couple minutes of looking and scratching my head, the drives just started working without any intervention from myself. Very odd??? Anyway, are you still having this issue? Marked as answer by IamMredMicrosoft employee, Owner Friday, April 30, 2010 1:02 AM Tuesday, April 06, 2010 10:56 PM Reply | Quote Moderator Microsoft is conducting an online survey to understand your opinion of the