scaniafreak Posted January 5, 2007 Share Posted January 5, 2007 (edited) hey peepz,it is possible to make an if-statement in a batch file to check if their is an D-partition to redirect My Docmunts to it?like this:if exist d:/then input regfile for redirectionNOTE: i have to partition the disk manual in XP setup, but it has only a drive letter then, no filesystem or label yetso is it possible to check for the existance of D: and input the regfile in the registery to the desired path?so yes, how does the if statement look like, since i'm a noob with this kind of things thanks in advance Edited January 5, 2007 by scaniafreak Link to comment Share on other sites More sharing options...
redfive19 Posted January 5, 2007 Share Posted January 5, 2007 No you cannot BUT what you can do is create a batch file or VBS script to accomplish this and call it from commandlines.txt. Hope this helps. Link to comment Share on other sites More sharing options...
scaniafreak Posted January 5, 2007 Author Share Posted January 5, 2007 (edited) ok thats clear. . but wat has to be in that batch file. and with VBS i'm really a noob, so that's not an option, or somebody has to make a script Edited January 5, 2007 by scaniafreak Link to comment Share on other sites More sharing options...
redfive19 Posted January 5, 2007 Share Posted January 5, 2007 (edited) Well, by your example, you would have to first format the partition. You should consider booting to a BartPE disk and running DISKPART (or scripting it). DISKPART can create all of your partitions and assign drive letters (even though these drive letters won't always be the same). You can also format these partitions in Bart PE. After that, you can pretty much run a regedit /s mydocs.reg (or whatever your reg file name is) from commandlines.txtYou could also format the 2nd partition (after creating the drive letter in DISKPART) via the commandlines.txt. Edited January 5, 2007 by redfive19 Link to comment Share on other sites More sharing options...
scaniafreak Posted January 5, 2007 Author Share Posted January 5, 2007 so the syntax of the driveformatting should look like this:echo offformat d: /autotest /FS:NTFS /V:Dataexitmy question is how to check for the existance of D:. should it look like this?:if exist D: regedit /s mydocs.reg Link to comment Share on other sites More sharing options...
redfive19 Posted January 5, 2007 Share Posted January 5, 2007 (edited) format d: /FS:NTFS /v:Data /q /yYou can guarantee the existence of D: if you use DISKPART prior to installing XP. I believe physical drives/partitions take letter precedence over DVD-ROM drives etc.Are you saying that D: will not always exist on every box you roll this out on? If that's the case, you can copy over a small dummy file (say source.txt) to the root of D: and have a batch file do a search in the root directories of all drives for existence of this dummy file. There's an example in the unattended guide for how to set the variable for the CD-ROM with this method.http://unattended.msfn.org/unattended.xp/view/web/59/ Edited January 5, 2007 by redfive19 Link to comment Share on other sites More sharing options...
scaniafreak Posted January 5, 2007 Author Share Posted January 5, 2007 (edited) ok. thanks for the help. i'm going to check out DISKPART Edited January 5, 2007 by scaniafreak 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