Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
tim

A mega easy to get the CDROM variable set

Recommended Posts

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 /?

Share this post


Link to post
Share on other sites

this will only work from CMDLINES.TXT if the CMD file is on CD. Won't work from SVCPACK or GUIRUNONCE.

So you know.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

Ok, just trying to help.

For what I need it does me fine.

and it's neat , I like that :)

Share this post


Link to post
Share on other sites
Guest zippy

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

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

%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? :))

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 /?

Share this post


Link to post
Share on other sites

@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 :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
1 thread/per month about sharing %CDROM%...

Thanks for this vital information, zippy :)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...