Main menu

Search
Login
Signup
Links
<< Previous thread | Next thread >>   
[BATCH : Usb] Cambio lettera dell'unità USB

Author Post
icemax
Mon 23 Jul 2007 - 17:55

online
Registered Member #194
Joined: Sun 21 Jan 2007 - 22:27
Posts: 1371

windows assegna automaticamente all'unità usb inserita nel drive , la prima disponibile
Con questo script invece avremo la possibilità di imporre a windows di riassegnare,
una volta inserita la penna usb, una delle lettere disponibili tra :
R:,
T:,
V:
oppure ..
X:


lo script sotto deve essere copiato su di un file batch con nome
RIMONTA.BAT

@ECHO OFF
CLS
REM  MVol-E ( v2.1 release 1-1-2006 )
REM  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
REM
REM  This program remounts any PHYSICAL volume from the
REM  letter E: to the first available letter R:, T:, V: or X:
REM
REM  Writen by: Jos van der Esch  
REM   
REM
REM *** Controllo se il volume E .. è in uso ***
SET DRVE=?
FOR %%a IN (E) DO (MOUNTVOL %%a: /L >NUL 2>&1 || SET DRVE=%%a:)
IF "%DRVE%"=="?" GOTO BEGIN
GOTO READY
:BEGIN
REM *** lettura delle impostazioni del volume E ***
SET DKEY=?
FOR /F "delims=" %%x IN ('MOUNTVOL E: /L') DO SET DKEY=%%x
REM *** trova la prima lettera disponibile tra X V T R***
SET FDRV=?
FOR %%b IN (X V T R) DO (MOUNTVOL %%b: /L >NUL 2>&1 || SET FDRV=%%b:)
REM *** impostazioni ***
IF "%DKEY%"=="?" GOTO READY
IF "%FDRV%"=="?" GOTO READY
REM *** Elimina il volume E e lo assegna come altra unità tra X V T R***
MOUNTVOL E: /D
MOUNTVOL %FDRV% %DKEY%
GOTO READY
:READY
CLS
EXIT


***** troverete in allegato lo script completo ******
si ringrazia l'autore dello script : -eMail-

info : utility Microsoft inserita in WinXP -> MOUNTVOL
Crea, elimina o visualizza il punto di montaggio di un volume.
Il comando mountvol consente di collegare volumi senza utilizzare una
lettera di unità.


Sintassi
mountvol [Unità:]Percorso NomeVolume
mountvol [Unità:]Percorso/d
mountvol [Unità:]Percorso/l
mountvol [Unità:]Percorso/p
mountvol/r
mountvol/n
mountvol/e
mountvolUnità:/s

Parametri

[ Unità:]Percorso
Specifica la cartella delle directory NTFS esistenti in cui verrà collocato il punto di montaggio.

NomeVolume
Specifica il nome del volume oggetto del punto di montaggio. Il nome del volume è
espresso nel formato \\?\Volume{GUID}\, dove {GUID} è l'identificatore univoco
globale (GUID), ad esempio \\?\Volume\{2eca078d-5cbc-43d3-aff8-7e8511f60d0e}\.


1185206138_194_FT0_rimonta.rar

[ Edited Mon 23 Jul 2007 - 19:50 ]
Back to top
Bourne
Mon 23 Jul 2007 - 18:21

online
Registered Member #4287
Joined: Fri 20 Apr 2007 - 16:55
Posts: 571
Grazie, il tutto è molto interessante. Per caso il cambio lettere funziona anche con account non admin?

ciao
Back to top
Danix
Mon 23 Jul 2007 - 19:50

online

Registered Member #1
Joined: Fri 29 Dec 2006 - 05:38
Location: Sassari
Posts: 12956
Comunicazione di servizio: i titoli non kilometrici.
Grazie.
Back to top
Website
Bourne
Tue 24 Jul 2007 - 00:12

online
Registered Member #4287
Joined: Fri 20 Apr 2007 - 16:55
Posts: 571
Bourne wrote ...

Grazie, il tutto è molto interessante. Per caso il cambio lettere funziona anche con account non admin?


Sì, c'è bisogno di diritti admin (quindi addio internet café e tutti i pc con Vista), quindi a questo punto anche il free remount (circa 10KB) del grande uwe sieber (che ha fatto anche un attrezzo che non richiede diritti admin visto che corre come servizio) può servire:

----------------------------------------------------------
Usage:

ReMount X: Y:

X: is the current drive letter
Y: is the new drive letter

or using mount points:
ReMount X: "E:\MyCardReader\Slot 1"

X: is the current drive letter
E:\MyCardReader\Slot 1 is the new mount point which must be
an empty folder on an NFTS drive

Works under Windows 2000, XP and higher only.

Under XP it can remount a local drive's letter even it's currently
used as network share.
----------------------------------------------------------------------------------

ciao ciao
Back to top
icemax
Tue 24 Jul 2007 - 09:10

online
Registered Member #194
Joined: Sun 21 Jan 2007 - 22:27
Posts: 1371
ReMount : -Link-

-Link-

Back to top

Moderators: Danix, Taf, Rcs, Energy, zandet2, ZioZione, Admin, LordJim60

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System