Apologies if incorrect group - Mapped drive rename from batch error
- From: Richhall <rje.hall@xxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 03:02:56 -0800 (PST)
All
On Windows XP I am running the following script from a .cmd batch to
rename a drive. The problem is I have named the drive before using
this, and it seems to be remembering the previous name, and I cannot
change it. Why is this please?
setlocal
set drv=J
set drv=%drv:"=%
set nn="MY DRIVE"
set nn=%nn:"=%
set mn="%TEMP%\MapName_%RANDOM%.VBS"
if exist %mn% del /q %mn%
set er="%TEMP%\MapName_%RANDOM%.TMP"
if exist %er% del /q %er%
@echo Set oShell = CreateObject("Shell.Application")>%mn%
@echo DRIVE = "%drv:~0,1%:\">>%mn%
@echo oShell.NameSpace(DRIVE).Self.Name = "%nn%">>%mn%
call :quiet>%er% 2>&1
del /q %mn%
del /q %er%
Cheers
Rich
.
- Follow-Ups:
- Re: Apologies if incorrect group - Mapped drive rename from batch error
- From: Pegasus \(MVP\)
- Re: Apologies if incorrect group - Mapped drive rename from batch error
- Prev by Date: Re: Hard drive light flickers continuously.
- Next by Date: Big latency is occured on startup after chkdsk
- Previous by thread: Re: how to desactivate firewall
- Next by thread: Re: Apologies if incorrect group - Mapped drive rename from batch error
- Index(es):
Relevant Pages
|
|