Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 09-16-2008, 07:31 AM   #1 (permalink)
SchoolBoy's Avatar
 
Newb Techie

Join Date: Sep 2008

Posts: 3

SchoolBoy is on a distinguished road

Default Quick Batch File Help

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
SchoolBoy is offline  
Old 09-16-2008, 09:58 AM   #2 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Quick Batch File 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.
__________________

Need website help? PM me!
CrazeD is offline  
Old 09-16-2008, 12:04 PM   #3 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Quick Batch File Help

Add a quote at the beginning of TO also. eg. "TO"
__________________

Baez is offline  
Old 09-16-2008, 12:35 PM   #4 (permalink)
SchoolBoy's Avatar
 
Newb Techie

Join Date: Sep 2008

Posts: 3

SchoolBoy is on a distinguished road

Default Re: Quick Batch File Help

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
SchoolBoy is offline  
Old 09-16-2008, 12:39 PM   #5 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Quick Batch File Help

Have you tried just using copy instead of xcopy?
__________________

Baez is offline  
Old 09-16-2008, 12:56 PM   #6 (permalink)
SchoolBoy's Avatar
 
Newb Techie

Join Date: Sep 2008

Posts: 3

SchoolBoy is on a distinguished road

Default Re: Quick Batch File Help

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 =)
SchoolBoy is offline  
Old 09-16-2008, 10:42 PM   #7 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Quick Batch File Help

Quote:
Originally Posted by cvb724 View Post
Add a quote at the beginning of TO also. eg. "TO"
Whoops.

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.
__________________

Need website help? PM me!

Last edited by CrazeD; 09-16-2008 at 10:44 PM.
CrazeD is offline  
Old 09-18-2008, 11:33 AM   #8 (permalink)
mikesgroovin's Avatar
 
HONK if you route packets

Join Date: Sep 2003

Posts: 4,664

mikesgroovin will become famous soon enoughmikesgroovin will become famous soon enough

Default Re: Quick Batch File Help

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.
__________________
A+, Net+, Sec+, Server+, Linux+, MOUS(2000 & '03), MCSE, MCSA, MCT, CNA, CCNA, CCDA, CCNP, CCSP
mikesgroovin is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A sneaky, and annoying virus donaldj HijackThis Logs (finished) 25 06-16-2008 08:58 PM
Possible Corrupted/Infected Files. xXxexpertxXx Virus - Spyware Protection / Detection 11 03-12-2008 01:18 AM
WTF is a Bad Block? MikesCreation Hardware Troubleshooting 18 02-24-2008 09:31 PM
seagate 80gigs failing.. acuariano Hardware Troubleshooting 27 08-27-2007 10:43 PM
Another Hijack Log boo HijackThis Logs (finished) 17 06-26-2007 12:30 PM