Jump to content

speed up copying <30kb files

billionare m1

The problem i have is im using xcopy and robocopy, with all the arguments that should make it fast.

 

Each folder is under 30kb, although it does take around 2 seconds, needing me to put a "timer"  between these commands

 

Here is an example of the main module thats slow

 

@echo off

CONSOLESTATE /Hide <- Hides Cmd for Timeout

Robocopy /NP /MT "C:\Users\_\Documents\Ex\IconF\Blank" "C:\Users\_\Desktop" /mir  <- Replaces desktop folder with empty folder

timeout 2 > nul 

xcopy /j /e /q C:\Users\_\Documents\Ex\IconF\Adobe C:\Users\_\Desktop <- Copies contents of folder over to Desktop


timeout 2 > nul 

cd..
start DesktopOK.exe /load /silent c:\users\_\Documents\Ex\IconL\Adobe.dok 
<- Loads icon locations
 

 

Yeah its only 2 seconds each but for this purpose/use i would strongly prefer there being a faster method. Its only up to 30kb anyways so i dont see the long delay, especially since manual copy paste works almost instantly

 

If there is a program perhaps or another language that can do this, I can work with it so anything you have i can try use 😁

 

Thanks in advance! 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

timeout 2 makes the script wait 2 seconds ... so duh.

 

use start.exe with the /wait parameter in front of the commands.

 

Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
      [command/program] [parameters]

    "title"     Title to display in window title bar.
    path        Starting directory.
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the application
                enables ^C processing, ^Break is the only way to interrupt
                the application.
    I           The new environment will be the original environment passed
                to the cmd.exe and not the current environment.
    MIN         Start window minimized.
    MAX         Start window maximized.
    SEPARATE    Start 16-bit Windows program in separate memory space.
    SHARED      Start 16-bit Windows program in shared memory space.
    LOW         Start application in the IDLE priority class.
    NORMAL      Start application in the NORMAL priority class.
    HIGH        Start application in the HIGH priority class.
    REALTIME    Start application in the REALTIME priority class.
    ABOVENORMAL Start application in the ABOVENORMAL priority class.
    BELOWNORMAL Start application in the BELOWNORMAL priority class.
    NODE        Specifies the preferred Non-Uniform Memory Architecture (NUMA)
                node as a decimal integer.
    AFFINITY    Specifies the processor affinity mask as a hexadecimal number.
                The process is restricted to running on these processors.

                The affinity mask is interpreted differently when /AFFINITY and
                /NODE are combined.  Specify the affinity mask as if the NUMA
                node's processor mask is right shifted to begin at bit zero.
                The process is restricted to running on those processors in
                common between the specified affinity mask and the NUMA node.
                If no processors are in common, the process is restricted to
                running on the specified NUMA node.
    WAIT        Start application and wait for it to terminate.
    command/program
                If it is an internal cmd command or a batch file then
                the command processor is run with the /K switch to cmd.exe.
                This means that the window will remain after the command
                has been run.

                If it is not an internal cmd command or batch file then
                it is a program and will run as either a windowed application
                or a console application.

    parameters  These are the parameters passed to the command/program.

NOTE: The SEPARATE and SHARED options are not supported on 64-bit platforms.

 

Link to comment
Share on other sites

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

×