Page 1 of 1 1
Topic Options
#201438 - 2011-01-24 12:55 PM USB Driveletter
Jappie Offline
Fresh Scripter

Registered: 2009-05-07
Posts: 7
Loc: chcago
I couldn't find a solution when i search this forum, so i try this:
I want to run a KIX script from my USB drive on many different computers.
As you know the drive letter can be changed from USB.

How can kix detect in what drive letter youre USB drive is ?

Top
#201439 - 2011-01-24 01:18 PM Re: USB Driveletter [Re: Jappie]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Why would you care about the drive letter?

I have kix-based software that performs many different software product installs, and it can run from CD/DVD, network share, flash, even floppy if you can find one without knowing the drive letter it was launched from. ALL of the scripts are written to avoid any disk reference - it all runs from the root of the "current" drive where the script was launched from. Any batch files are written to run from the folder they were called from or lower - never a higher reference.

The exception to this is /BIN, a folder where the Kix32.exe and any other external commands are kept. These are references as "/bin/prog.exe" when they are needed.

After 10 years of using this internally and at several clients, we'd never needed to know the drive letter where the script ran from. The point is - using drive letters will complicate the process. Think about "/" and not "F:/" and you'll be better off.

If Kix32 and the .KIX file are on the flash, the @CURRDIR and @SCRIPTDIR macros will provide the path where the script was started and is currently executing from. They both begin with the drive letter.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201440 - 2011-01-24 01:44 PM Re: USB Driveletter [Re: Glenn Barnas]
Jappie Offline
Fresh Scripter

Registered: 2009-05-07
Posts: 7
Loc: chcago
You are right about that, but should this do the trick ?

Shell '%comspec% /c Xcopy /D /R /H /Y "@CURDIR\directory\file.xxx" "c:\temp\test"'

Top
#201441 - 2011-01-24 04:03 PM Re: USB Driveletter [Re: Jappie]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Originally Posted By: Jappie
You are right about that, but should this do the trick ?

Shell '%comspec% /c Xcopy /D /R /H /Y "@CURDIR\directory\file.xxx" "c:\temp\test"'


You should be OK with that, though I'd suggest that @SCRIPTDIR is better. You probably don't need %COMSPEC% /C unless you intend to redirect the output from the command.

 Originally Posted By: Glenn the secret Linux advocate
Think about "/" and not "F:/"

I think that's a *nix Freudian slip there.

Top
#201442 - 2011-01-24 07:30 PM Re: USB Driveletter [Re: Richard H.]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
LOL - So it is. Glenn you know Windows doesn't like you to "switch" on them.
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.053 seconds in which 0.022 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org