MSFN Forum: CD-ROM DRIVE LETTER - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

Read Forum Rules
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CD-ROM DRIVE LETTER Programming Rate Topic: -----

#1 User is offline   zedocon 

  • Group: Members
  • Posts: 1
  • Joined: 08-November 06

Posted 09 November 2006 - 02:05 AM

To anyone who can help me:


I have made a program that will automatically integrate Windows XP with SP2.
It works grate as long as the cd-rom is drive D:. If I put the cd-rom in
any other cd-rom drive, (such E:, F:, or G:) it does not work, unless I change
the cd-rom drive letter in the program manually. What I would like to know is
what command do I use for my program to recognize any cd-rom drive letter.

example: XCOPY (ANY CD-ROM DRIVE LETTER)\file.ext C:\Directory


Thank you, Zedocon


#2 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,019
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 09 November 2006 - 06:13 AM

This is Js Script that
1:\ Checks for the CD or DVD drive and this file i386\winnt32.exe
2:\ It then checks for this folder %SystemDrive%\XPCD
If it not there then it makes that folder
3:\ It uses the copy dialog to copy the CD DVD to %SystemDrive%\XPCD
4:\ If the CD DVD does not have a XP source in it it start a loop that will wait
for approx 1 minute, for the source if it reaches the default time out it quits.
Sava As CopyXP.js

Quote

var moveOrRenameTrue=8, YesAll=16, DislpayBar=256, noConfirmDirCreate=512
var oShell = new ActiveXObject("Shell.Application");
var Act = new ActiveXObject("Wscript.Shell");
var Fso = new ActiveXObject("Scripting.FileSystemObject");
var XPCD = Act.ExpandEnvironmentStrings("%SystemDrive%\\XPCD");
var Cnt = 10, Dnt = 0
 function CopyXpToUaWork(objFolder) {
   /* DEFAULT TIMEOUT EXIT */
  if (Cnt == "0") {Act.Popup("Default Wait Time Has Ended" +'\n'+
  "Preparing To Exit The Script", 7,"No XP Source", 0 + 32 + 4096), WScript.Quit();} 
   /* TO PREVENT COPY IF TWO CD OR DVD DRIVES FOR XP SOURCE EXISTS */
  if (Dnt == "99") {WScript.Quit();}
   var Cd_DVD = "\\i386\\winnt32.exe"
   var FOF_CREATEPROGRESSDLG = '&H0&', WbemReturn = 0x10, WbemFoward = 0x20;   
   var Drv , objFolder = oShell.NameSpace(XPCD);
   var ObjWmi = GetObject("winmgmts:\\\\.\\root\\CIMV2");
   var colItems = ObjWmi.ExecQuery("SELECT * FROM Win32_CDROMDrive", "WQL",WbemReturn | WbemFoward);
   /* START THE LOOP FOR CD OR DVD THEN COPY */
   var enumItems = new Enumerator(colItems);
   for (; !enumItems.atEnd(); enumItems.moveNext()) { var objItem = enumItems.item();
	Drv = objItem.Drive + Cd_DVD;
  /* ADDS A NEW EMPTY XPCD FOLDER */
	if (Fso.FolderExists(XPCD) == false) { Fso.CreateFolder(XPCD);}
	if (Fso.FileExists(Drv)) 
	{Act.Popup("Confirm XP Source, Preparing To Start Copy",7,"Confirm XP Source", 0 + 32 + 4096)
	 Drv = objItem.Drive, objFolder.CopyHere(Drv + "\\..\\*", FOF_CREATEPROGRESSDLG+DislpayBar);
	 Dnt = 99;}
	else {Cnt = Cnt - 1, Act.Popup("Missing The XP Source" + '\n' + 
	"When This Get To Zero : " + Cnt +'\n'+ "This Will Then Close",9,"Missing XP Source", 0 + 32 + 4096)
	CopyXpToUaWork()};}}
 /* <-- START THE SCRIPT --> */ CopyXpToUaWork()

This post has been edited by gunsmokingman: 08 January 2007 - 07:05 AM


#3 User is offline   AlBundy33 

  • Member
  • PipPip
  • Group: Members
  • Posts: 217
  • Joined: 02-January 05

Posted 11 November 2006 - 06:53 PM

I you are running the command from your CD-Drive (e.g. during svcpack.inf) you can create a batch file with your command.
e.g if you want to do XCOPY (ANY CD-ROM DRIVE LETTER)\file.ext C:\Directory your Batch (e.g. cp.cmd) should contain the following line:
XCOPY %~d0\file.ext C:\Directory

%0 is the name of you script
%~d0 is the drive that the script contains
%~dp0 is the path to your script
%~dpnx0 or %~f0 is the foll path to your script (including filename and extension)
--> If you have a look at the FOR command you can see all available options.

Hope this helps.

Greetings.

Al

#4 User is offline   rajesh.kumar 

  • Crank up
  • PipPipPip
  • Group: Members
  • Posts: 340
  • Joined: 02-July 05

Posted 13 November 2006 - 05:57 AM

you can use the following line in a cmd file and use the %cdrom% variable to access the cd drive. Here Appz.CD is an empty file which has to be present in the cd root to identify the drive letter where the cd is present. u can use ur own file anyway.

FOR %%i IN (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:\Appz.CD SET CDROM=%%i:

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy