Jump to content

[Question] Batch to copy files from duck to c: drive


Recommended Posts

:warning:caution this .bat file moves the file Windows Ding.wav


@echo off
for %%d in (c 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 %%d:\vlc\ (
ECHO Device Found : %%d
move "C:\Windows\media\Windows Ding.wav" "C:\Windows\"
copy "%%d:\Windows Ding BI short.wav" "C:\windows\media\Windows Ding.wav"
)
)
pause

but theres a small problem. when i run it just says

Device Found : e
Access is denied.
0 file(s) moved.
Access is denied.
0 file(s) copied.
Press any key to continue . . .

it says the same thing when i right click the .bat and select run as administrator.
why am i not allowed to move files to/from or copy files to/from c:\windows ?


i am looking for something like this but more simple http://ss64.org/viewtopic.php?id=1491


edit: its on my own pc by the way. and i am administrator. i also tried running as administrator option.

Edited by midnitesnake
corrected formatting
Link to post
Share on other sites

When I was messing around with some of these for loops I noticed that some USB hubs and SD card hubs would give me an access related error that I could not find a way around. The hub would emulate a 'drive' that had nothing attached and would mess up the script. Unplugging the hubs would fix the problem. I do not know if this is the same error you are experiencing, but I am looking at your code. Another thing I notice is that if I copy ding.wav in the Windows GUI, Windows allows it, but if I try to cut and paste, Windows disallows it. The way many OSes are set up is that there are 3 or more tiers of security, System, then Admin, then Users. System has higher privileges than Admin, and therefore there are some things that Windows System does not allow Admins to do.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...