Quick Batch File Help

Status
Not open for further replies.

SchoolBoy

Beta member
Messages
3
Hi im not sure if this is in the right section but i assume that you programmers will be able to help me out

I was wandering if somebody could help me write a quick batch file code that replaces one file with another for example i need to replace

(A) C:\Documents and Settings\04pires.ep\Application Data\Microsoft\Internet Explorer\Desktop.htt

with

(B) D:\Desktop.htt

and i was wandering if anyone could right a quick batch file that would replace A with B because i have had a look around but cant seem to find a quick code

Thanks for you help
 
Code:
xcopy "FROM" TO" /Y

Put the original location in-place of FROM, and the ending location in-place of TO (keep quotes). /Y will suppress the alert to overwrite existing files, remove it if you don't want that.
 
Thanks for the help but as i do not have full administrative privallages the ability to copy over files on the C drive using a Batch file has been blocked

however you can do it manually so im not sure why it says Access Denied. do you think there is any other way of swapping them possibly using a script or something along those lines. not by "hacking" of corse but just for convieniance because it does take a while to find the file then replace it and i would like just to be able to do it instantly.

But thanks for you help and quick replies earlier
 
Sorry doesnt work im not sure if it says access denied as i cant read that fast but maybe if i explain my problem you will have a better way of doing it then i intend

The School imposes a policy that makes it near impossible to change your desktop background however i came accross a file in

"C:\Documents and Settings\04pires.ep\Application Data\Microsoft\Internet Explorer"

called Desktop and it was in a Hyper Text Template Format when you open the file in a notpad you get a code that basicly says that the desktop background should be set as a certain file but i wrote a code in the file which is a simply HTML script:

<body background="D:\Wallpapers\Wallpaper.bmp">

and saved is as Desktop.htt in the same file and lo and behold the desktop background changed to the one that i wanted only problem is that when i lock my computer it resets its self so i was wandering if it would be possible to create a one click batch file or something that would change the file instantly instead of having to input that code in and save it every time because it is a bit long winded and if you have to do that every time then theres no point

Thanks for reading if you have any ideas please let me know =)
 
Add a quote at the beginning of TO also. eg. "TO"

Whoops. :p

EDIT: By the way, if you add "pause" to your batch file (without quotes) it will stop and say "press any key to continue", allowing you to see any errors or such.
 
You can also just open up the command prompt and as long as your script doesn't have an "exit" in it, it will stay open.
 
Status
Not open for further replies.
Back
Top Bottom