Batch script Clarification

February 23, 2011 at 20:45:29
Specs: Windows XP
How to create a batch script to delete and replace a file

See More: Batch script Clarification

Report •

#1
February 23, 2011 at 21:52:48
type nul > filename.ext


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
February 23, 2011 at 21:57:22
Or to replace an existing file with another existing file:

move "newfile.ext" "oldfile.ext"


Report •

#3
February 23, 2011 at 22:50:42
Guys,

1) Actually i need to delete a Folder and a file from a path for eg: C:\Program Files\HiCommand\Base\CC\web\containers\HiCommand\webapps

2) Paste another File in the same above mentioned path.

Thanks a lot guys for your reply.

Senthil


Report •

Related Solutions

#4
February 23, 2011 at 23:03:55
Your going to be more specific....

Report •

#5
February 23, 2011 at 23:18:35
move /?
del /?
rd /?
md /?
copy /?
xcvvopy /?


=====================================
Life is too important to be taken seriously.

M2


Report •

#6
February 23, 2011 at 23:25:41
Hi M2,

xcvvopy /?

Looks like a typo.

***********************************************************
Can't say I have used it, but replace also looks promising:

replace /?


Report •

#7
February 24, 2011 at 00:35:09
Hi Judago,

yep, typo


=====================================
Life is too important to be taken seriously.

M2


Report •

#8
February 24, 2011 at 03:15:18
ANy Valuable answers pls. URGENT

Report •

#9
February 24, 2011 at 03:15:59
Yes Judgo

Report •

#10
February 24, 2011 at 03:22:11
Your still missing the details:


1) Actually i need to delete a Folder and a file from a path for eg: C:\Program Files\HiCommand\Base\CC\web\containers\HiCommand\webapps

2) Paste another File in the same above mentioned path.

It still lacks the file name and the name of the directory to be deleted.

rem the next command will completely remove "t:\he\directory"
rem along with anything in it(doesn't go to the recycle bin).
rd /s "t:\he\directory"

rem delete the file (again doesn't go to the recycle bin)
del "t:\he\file"

rem copy the file into the base dir
copy "t:\he\file.ext" "t:\he\dir\filename.ext"


If you won't give all of the details you won't get very good help.


Report •

Ask Question