Jump to content
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. ×

Percentage Complete Coding for CMD?


Recommended Posts

When I copy the i386 directory to the hard drive during setup, it takes a REALLY long time, and i was just wondering if there was any way for it to tell me how much is left to copy in the CMD prompt. Any thoughts?

Link to post
Share on other sites

Im not using true DOS, im looking for a counter in the cmd prompt that tells me how much copying is done. ex.

NOW COPYING THE i386 DIRECTORY TO %SYSTEMDRIVE% ...... ??% Complete.

What command will tell me how complete it is?

Link to post
Share on other sites
Im not using true DOS, im looking for a counter in the cmd prompt that tells me how much copying is done. ex.

NOW COPYING THE i386 DIRECTORY TO %SYSTEMDRIVE% ...... ??% Complete.

What command will tell me how complete it is?

i can be very short about this.

Nothing. you can't see that

Link to post
Share on other sites

It is possible ;p I found it on some website, so the code isn't mine...

@Echo Off
::Copy the first file.
Call :Pcopy "source 1" target1 /Options
::Copy the second file.
Call :Pcopy source2 "target 2" /Options
(Goto :EOF)

:Pcopy
Set Flagfile=%TEMP%.\%RANDOM%.tmp
If Exist %Flagfile% Del %Flagfile%
Start /Min Copy %* ^& Echo.^>%Flagfile% ^& Exit
(Set /P i=Copying %1) < NUL
:Pcopy1
If Exist %Flagfile% (Goto :EOF)
::Echo period w/o carriage return/line feed
(Set /P i=.) < NUL
::Wait one second (increase no. of ping requests
::in order to wait for a longer time)
Ping -n 2 127.0.0.1 > NUL
Goto Pcopy1

Hope it helps...

Link to post
Share on other sites
i can be very short about this.

Nothing. you can't see that

What about this then? copybar.zip It is a cmd file without third party tools etc. which I have wrote as an example. It works fine on my test systems.

Just make sure that there's enough space on your system drive, pop your CD-ROM in, stop it spinning up, unpack the file, double click and watch!

Regards

Link to post
Share on other sites

I know, it even impressed me!

I could have stopped at just answering the request, but percentage, number of files to copy, number copied, source and destination names and a progress bar

I'm just too kind :yes:

Link to post
Share on other sites
I know, it even impressed me!

I could have stopped at just answering the request, but percentage, number of files to copy, number copied, source and destination names and a progress bar…

I'm just too kind :yes:

Trully impressed! :ph34r:

Do you think it would be possible to adapt this script to move some big files, like a ISO, by checking the total size of the file to be transfered?

Link to post
Share on other sites
I know, it even impressed me!

I could have stopped at just answering the request, but percentage, number of files to copy, number copied, source and destination names and a progress bar…

I'm just too kind :yes:

You never fail to impressed me. :thumbup:thumbup:thumbup

Link to post
Share on other sites

Here a vbs file that uses the built in move copy graph from windows.

I have It set to Copy the XP CD to %Systemdrive%

Dim Act, CD, Fso, Folder, Shell, SD, strCd

Set Act = CreateObject("Wscript.Shell")

Set Fso = CreateObject("Scripting.FileSystemObject")

SD = Act.ExpandEnvironmentStrings("%Systemdrive%")

set Shell = CreateObject("Shell.Application")

Function CD_Copy

Set CD = Fso.Drives

For Each strCd In CD

If strCd.DriveType = 4 Then

If Fso.FileExists(strCd & "\win51") Then

Act.Popup "This Is A XP CD, " & strCd ,5,"Confirm XP CD", 0 + 32

Copy_XP

Exit Function

Else

Act.Popup "This Is Not The Correct CD",5,"Incorrect CD", 0 + 32

End If

End If

Next

End Function

Function Copy_XP

If Not Fso.FolderExists(SD & "\XPCD") Then Fso.CreateFolder(SD & "\XPCD") End If

set Folder = Shell.NameSpace(SD & "\XPCD")

if not Folder is nothing then

Folder.CopyHere(strCd & "\..\*.*")

set Shell = nothing

set Folder = nothing

End If

End Function

CD_Copy

Edited by gunsmokingman
Link to post
Share on other sites
i can be very short about this.

Nothing. you can't see that

What about this then? copybar.zip It is a cmd file without third party tools etc. which I have wrote as an example. It works fine on my test systems.

Just make sure that there's enough space on your system drive, pop your CD-ROM in, stop it spinning up, unpack the file, double click and watch!

Regards

@Yzöwl

Nice script. :thumbup It runs under WinPE after adding required files (not third party tools but OS command line tools) find.exe and mode.com in my image. but takes too much time from copying files one by one rather than *.*

@gunsmokingman

I would like to try your script but using a network drive (or HDD in external enclosure) as source instead of CD Drive. could the code been changed for checking the ident file on these installation media like S:\WIN51

Edited by Bilou_Gateux
Link to post
Share on other sites

This can be any drive letter as the scripts looks for an instance of that file.

(strCd & "\win51"), strCd is the array that holds the drive letters for CD or DVD

drive.

Here how I tested the script, I first place a XP Cd in my real drive then it copy it

to the XPCD, I then ejected the CD and mounted a ISO image of XP in a Virtual

drive the script reported the real CD drive as incorrect but started the copy from

virtual drive next.

So the drive letter does not matter as it will go threw all CD or DVD drive letters.

Until a true statement exists, if nothing is found then the script will keep reporting

Incorrect CD until all the CD or DVD drives in the array are finished.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...