bumjack Posted October 14, 2008 Share Posted October 14, 2008 im trying to run WPI via USB stick but the path to WPI could not be find..i have tried to put a batch file before i start WPI, the same..the WPI path does not exist in the USB Folder, the folder is c:\WPI\wpi.cmd. (%OEM% Folder)wehn in try to put WPI in the USB path, i cant start it after installation, windows couldnt find the USB drive letterhow could i teach windows to find the drive letter???the wpi codeFor /F "Tokens=4" %%a in ('vol') do Set USB=%%a@Echo Stick ist %USB%that work, when the batch will be put in the USB Folder.can anyone help me please Link to comment Share on other sites More sharing options...
cworkman Posted January 2, 2009 Share Posted January 2, 2009 (edited) im trying to run WPI via USB stick but the path to WPI could not be find..i have tried to put a batch file before i start WPI, the same..the WPI path does not exist in the USB Folder, the folder is c:\WPI\wpi.cmd. (%OEM% Folder)wehn in try to put WPI in the USB path, i cant start it after installation, windows couldnt find the USB drive letterhow could i teach windows to find the drive letter???the wpi codeFor /F "Tokens=4" %%a in ('vol') do Set USB=%%a@Echo Stick ist %USB%that work, when the batch will be put in the USB Folder.can anyone help me pleaseThis Is If The WPI.hta Is In The Root Of The USB Drivefor %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\wpi.hta Start %%i:\wpi.htaThis Is If WPI.hta Is In A Folder Called WPIfor %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\WPI\wpi.hta Start %%i:\WPI\wpi.hta Edited January 2, 2009 by cworkman Link to comment Share on other sites More sharing options...
AlBundy33 Posted January 3, 2009 Share Posted January 3, 2009 If your batch-file is also on the stick you can get the drive with %~d0drive: %~d0path to script %~f0 (= %~dpnx0)path to script-dir %~dp0have a look at the help for "for".Zusätzlich wurde die Ersetzung von Verweisen auf FOR-Variablen erweitert.Sie können jetzt folgende Syntax verwenden: %~I - Expandiert %I und entfernt alle umschließenden Anführungszeichen ("). %~fI - Expandiert %I zu einem vollständigen Dateinamen. %~dI - Erzeugt nur den Laufwerkbuchstaben von %I. %~pI - Erzeugt nur den Pfad von %I. %~nI - Erzeugt nur den Dateinamen von %I. %~xI - Erzeugt nur die Dateierweiterung von %I. %~sI - Erzeugter Pfad enthält nur kurze Dateinamen. %~aI - Erzeugt die Dateiattribute von %I. %~tI - Erzeugt Datum und Zeit von %I. %~zI - Erzeugt die Dateigröße von %I. %~$PATH:I - Durchsucht die in der PATH-Umgebungsvariablen angegebenen Verzeichnisse und expandiert die erste gefundene Datei %I zu dem vollständigen Dateinamen. Wenn der Name der Umgebungsvariablen nicht definiert ist oder diese Datei bei der Suche nicht gefunden wurde, wird dieser Parameter zu einer leeren Zeichenkette expandiert.Al Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now