net use command - WinXP Embedded
I'm trying to use the 'net use' command to map a drive from a Windows XP Embedded system(built using Target Designer), but when I try to execute the 'net use' command, it is un-recognized. The command works great on my desktop WinXP machine, just not on the embedded system. I'm not sure if we are missing a package that needs to be on the XP Embedded system?
Any help is greatly appre开发者_JAVA技巧ciated! Thanks!
Here is how i'm using the net use command:
net use X: \\150.168.80.4\Shared_Test
Here is what I'm trying to accomplish: Map to a drive from a WinXP Embedded machine only if the file server (Windows XP) is available. The batch file listed below is the one being run on the WinXP Embedded system.
:VERIFY
echo.
echo ----------VERIFYING FILESERVER AVAILABILITY----------
ping 150.168.80.4 -n 2
if errorlevel 1 goto RETRY
if errorlevel 0 goto MAPDRIVE
goto END
:RETRY
echo.
echo ----------FILESERVER UNAVAILABLE.......RETRYING!----------
goto VERIFY
:MAPDRIVE
echo.
echo ----------FILESERVER AVAILABLE.....TRYING TO MAP TO FILESERVER----------
net use X: \\150.168.80.4\Shared_Test
ping 127.0.0.1 -n 5 >NUL
IF NOT EXIST M:\ goto MAPDRIVE
IF EXIST M:\ goto END
:END
echo.
echo ----------FILESERVER MAPPING SUCCESSFUL....GOODBYE!----------
echo.
This is probably unrelated, but I see a problem you could be having--in the :MAPDRIVE section you are mapping the drive as letter X:, but then checking to see if drive letter M: is available... so even if X: mapped successfully, this batch script would loop forever until/unless you had an M:-drive.
As for XP-Embedded not having the 'net use' command, I dunno... In WinXP the net.exe command is found in "C:\Windows\System32\net.exe" by default. Can you check on your XP-Embedded has this executable? If so, do the commands net /?
or net use /?
give you syntax help?
The net command is provided by a Windows Embedded component called "Net.exe Utility". Search for it in Target Designer and add it to your target.
精彩评论