/build/static/layout/Breadcrumb_cap_w.png

Batch file to copy into c:\windows\inf

When copying from the network into c:\windows\inf manually I need to copy the files to a local folder first, then copy from the local folder into the inf folder. I need to do this with a batch file, but it still errors even when the batch tries to copy from C:\tools\mydrivers\6440 to C:\windows\inf\mydrivers\6440 with Access denied.

How can I copy files from the network into C:\windows\inf?
This occurs as a mid-level task.

Thanks

0 Comments   [ + ] Show comments

Answers (1)

Posted by: SMal.tmcc 9 years ago
Red Belt
0
here is my method to copy drivers as mid level.

create a zip file that contains the drivers you want to copy along with these 2 other files.


copy.vbs
CreateObject("Wscript.Shell").Run "copy.bat",0,True
copy.bat
md C:\Windows\inf\tmccdrivers\t440p

xcopy .\t440p\*.* C:\Windows\inf\tmccdrivers\t440p /s /q /y

create a post application task



Comments:
  • I was hoping you'd post your method. What is the reason you use a .vbs to call the .bat, instead of launching the .bat directly? - nheyne 9 years ago
    • you cannot upload a zip to a batch task but an application task will allow this. The application task is looking for an application to run not a batch file. So by calling a vbscript I give it that. you could write the vb script to do the md and xcopy command but a batch is easier to understand and change when needed. you can make the xcopy window show by changing the vb script - SMal.tmcc 9 years ago
      • Ah, makes sense. Thanks for explaining! - nheyne 9 years ago
  • So far, I've gotten it to copy the top level folder, but it won't copy the driver files or sub folders. Any idea why it would only get the top folder out of the zip? - murbot 9 years ago
    • did you use a pattern like I did? and use the /s switch and you need the *.* in the pattern (there is a dot in front of \t440)
      xcopy .\t440p\*.* C:\Windows\inf\tmccdrivers\t440p /s /q /y - SMal.tmcc 9 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ