Re: Apologies if incorrect group - Mapped drive rename from batch error




"Bob I" <birelan@xxxxxxxxx> wrote in message
news:eQ000HEZIHA.984@xxxxxxxxxxxxxxxxxxxxxxx
R-click the drive letter in My Computer and pick "Rename". Call it
whatever you want.


So it does! Applying this newly learnt piece of info, I knocked
together this batch file which makes sense AND works. You
need to change lines 2 and 3 to suit your requirements.
@echo off
echo >"%temp%\ren.vbs" drive = "Q:"
echo >>"%temp%\ren.vbs" NewName = "Shared Drive 2"
echo >>"%temp%\ren.vbs" Set oShell = CreateObject("Shell.Application")
echo >>"%temp%\ren.vbs" oShell.NameSpace("Q:").Self.Name = NewName
cscript //nologo "%temp%\ren.vbs"


.



Relevant Pages

  • Re: Persisting env vars in cmd windows
    ... The help text for the command you question goes like this: ... format by typing this: echo %date% ... If you don't then the batch file will fail. ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Win2000 Printing Nightmare
    ... Purge the print spooler, to do so at a command prompt issue the ... You can make a small batch file to do the above job, ... @echo off ... ping localhost -n 4> nul ...
    (microsoft.public.win2000.file_system)
  • Re: logging batch files
    ... @echo off ... REM the start of your batch file ... >set LogCmd= ... >:LogIt ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Batch File Parameters
    ... While your batch file uses a number of advanced features, ... > @echo off ... > goto GETNEXT ... > a folder in "My Documents" and move them to an Archive folder while ...
    (microsoft.public.windowsxp.general)
  • Re: Disk Free Space Alert
    ... If you want a percentage then you can run this batch file: ... $goto Start ... $ echo Press the Space Bar to close this window. ... $echo Free space on drive %Drive% is %percent%%% of capacity ...
    (microsoft.public.win2000.general)