Jump to content

Recommended Posts

Posted

Here is how:

SET CDROM=%CD:~0,2%

That's it.

Do this at the top of any .CMD file(s) that run from the install CD.

:)

To find out how this works, start a CMD.EXE session and type SET /?


Posted
this will only work from CMDLINES.TXT if the CMD file is on CD

From reading the many post here, that is what most people want it for.

e.g. setting RunOnce keys and the like.

Posted

some people also use a normal batch file with ECHO commands to tell them what's going on (the "basic" method, where as RunOnceEX is the "advanced" method) and so they use GUIRunOnce. Thought i should post that it won't there as expected so they don't complain later on. :)

Though this does simplify all those IF EXIST lines for people using CMDLINES.TXT to install something from ONE cd. :rolleyes: It won't work with two CDs if they are in different drives however. (I'm just listing possibilities that people may try to use this with)

Guest zippy
Posted

1 thread/per month about sharing %CDROM%...

%CD%, %0, SourcePath...etc... depends on how/where you use it...

Posted
SET CDROM=%CD:~0,2%

How's that working? I just mean: it's really neat :) , but what kind of command is that? I've never seen it before.

Posted

%CD% is your Current Directory, and since the RunOnceEx file will be run off the CD (Compact Disk this time :rolleyes:) the drive letter of the %CD% will be the CD. So.. what that command does, is to pull out the two first letters from the %CD% variable, so that if %CD% for instance is

"F:\$OEM$", then %CD:~0,2% will return "F:" only. (0,2 means begin at position 0 and read the next two letters. 2,6 would return "\$OEM$", if you understand? :))

Posted
0,2 means begin at position 0 and read the next two letters. 2,6 would return "\$OEM$", if you understand? :))

Cool, thx! :rolleyes:

Sure I understand ... but what I didn't know just seconds ago is that syntax. Haven't seen it before and didn't know it exists. Thx again! :D

Posted
Sure I understand ... but what I didn't know just seconds ago is that syntax. Haven't seen it before and didn't know it exists. Thx again!
Oh good, at least my post was some use to somebody :)
To find out how this works, start a CMD.EXE session and type SET /?
Posted

@tim

that's simply fantastic.

You da' wizard, dude!

Oh good, at least my post was some use to somebody
Somebody? Well, make that lots of buddies :)
Posted

That's a good find, Tim. And thanks for sharing it, too! Sorry about the people giving you a hassle for posting something interesting. They're just jealous of you, as they probably never have something to contribute themselfves. :)

Plenty people are grateful!

Thanks!

eNuffSaid

EDIT: Typos

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...