Jump to content

i need to delete/copy 2 files to another destination


madbull

Recommended Posts

I have 2 files (1 & 2) on the desktop and want to copy them to system32:

I am trying this - copy 1 + 2 %systemroot%\system32

but its not working.

I would also like to do the same but removing 2 files: So

del %systemroot%\system32\ 1 2.

i know that this is wrong;can anyone show me where i'm going wrong and the correct way(s).

Thanks,

PS.It doesn't matter if the file has an extension or not;that is to say if you give me an example you can add an extension to the files if you want.

Link to comment
Share on other sites


QED, you just need to handle them one at a time like so:

copy %userprofile%\Desktop\1 %SystemRoot%\system32
copy %userprofile%\Desktop\2 %SystemRoot%\system32

And then to delete:

del %SystemRoot%\system32\1
del %SystemRoot%\system32\2

Link to comment
Share on other sites

QED, you just need to handle them one at a time like so:

copy %userprofile%\Desktop\1 %SystemRoot%\system32
copy %userprofile%\Desktop\2 %SystemRoot%\system32

And then to delete:

del %SystemRoot%\system32\1
del %SystemRoot%\system32\2

Yes thats true, its just it says you can do it for multiple files i assumed that meant something similar to the above (my example).

Thanks for the reply (has helped clear up this matter),

Link to comment
Share on other sites

pushd %systemroot%\system32
del 1.ext 2.ext
popd

Dear Yzöwl,

Do you mean to say this will do what i wanted and secondly how?

What is that push part is that an option of the del command or another command?

Thanks a mil,

PS.I'm not sure if you've heard of the application i am creating but you will be featured (with your permission) along with all the others who have helped.

Link to comment
Share on other sites

The pushd and popd were used to move me to a location and return me to my start point again after running the deletion. The same task could have been performed without that addition thus:

del "%systemroot%\system32\1.ext" "%systemroot%\system32\2.ext"

It appears that you are trying to create something which is making a smaller OS source. If this is the case and you are removing OS files you may need to use:

DEL /F /A [file(s)]

Link to comment
Share on other sites

The pushd and popd were used to move me to a location and return me to my start point again after running the deletion. The same task could have been performed without that addition thus:
del "%systemroot%\system32\1.ext" "%systemroot%\system32\2.ext"

It appears that you are trying to create something which is making a smaller OS source. If this is the case and you are removing OS files you may need to use:

DEL /F /A [file(s)]

Yes i do somtimes use those options (force delete of read only files and the attribute option)

Thanks once again you have been a major help,

Link to comment
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...