Newbie: Exporting results of script to .txt file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
RyanD
Posts: 1
Joined: 19 Aug 2013 06:50

Newbie: Exporting results of script to .txt file

#1 Post by RyanD » 19 Aug 2013 06:58

Hi All,

Brand new to this forum and also DOS programming.

I've created a very simple script which should delete all the .DS_Store and thumbs.db files on one of our Windows network shares.

F:
DEL /S /A:H .DS_STORE
DEL /S /A:H ._.DS_STORE
DEL /S /A:H THUMBS.DB
> "*path*\DS_STORE&THUMBS_FTP.txt"
pause

Obviously I would like this to print out a .txt file called DS_STORE&THUMBS_FTP to the path specified, but when I do execute this, no file appears and I can't see any reason for this?

I know the path is correct because if I precede the last line with the 'dir' command it will write a directory listing into a file with that name in the path specified.

Like I said, I'm new to this but I appreciate any help anyone can provide :D

Another thing I'd like to ask- on this text file, is there a way to create it so the time & date print at the top of it?

Thanks again!

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Newbie: Exporting results of script to .txt file

#2 Post by foxidrive » 19 Aug 2013 09:31

Multi posted on other forums.

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Newbie: Exporting results of script to .txt file

#3 Post by penpen » 19 Aug 2013 11:04

I never find the crossposts using google...
maybe the googlebot is too slow or i am not clever enough...
nevertheless, the code is an oneliner (2 lines with the pause):

Code: Select all

DEL /S /A:H F:\.DS_STORE F:\._.DS_STORE F:\THUMBS.DB >> "*path*\DS_STORE&THUMBS_FTP.txt"
pause

penpen

Post Reply