Search found 17 matches

by Hooby1
12 Oct 2020 07:49
Forum: DOS Batch Forum
Topic: Batch to list file contents but sort newest first
Replies: 2
Views: 3326

Re: Batch to list file contents but sort newest first

Many thanks. I was after something along the line of:

dir /b /W /O-D > updates.txt

and this works great!
by Hooby1
12 Oct 2020 04:13
Forum: DOS Batch Forum
Topic: Batch to list file contents but sort newest first
Replies: 2
Views: 3326

Batch to list file contents but sort newest first

Is it possible to have a script that when executed, will export the file contents of a folder to a text file but show the exported results with the newest files (date modified) first?
by Hooby1
08 Oct 2020 06:47
Forum: DOS Batch Forum
Topic: Search and delete via batch
Replies: 9
Views: 7891

Re: Search and delete via batch

Steffen

Many thanks.

Works a treat.
by Hooby1
08 Oct 2020 05:59
Forum: DOS Batch Forum
Topic: Search and delete via batch
Replies: 9
Views: 7891

Re: Search and delete via batch

Steffen

Many thanks.

I added the switch to the line DEL /a:H "%%~i"

and that now deletes the hidden files.
by Hooby1
08 Oct 2020 04:00
Forum: DOS Batch Forum
Topic: Search and delete via batch
Replies: 9
Views: 7891

Re: Search and delete via batch

Steffen

Many thanks for this. Works great and speeds up searching for files.

However, the deletion doesn't happen when the files have an attribute as "Hidden" It writes to the log file but doesn't delete them.

Is it possible to make this batch delete the files when this attribute is set as that?
by Hooby1
03 Oct 2020 15:19
Forum: DOS Batch Forum
Topic: Batch Ping a network
Replies: 6
Views: 5056

Re: Batch Ping a network

Steffen

Many thanks.
by Hooby1
03 Oct 2020 13:13
Forum: DOS Batch Forum
Topic: Batch Ping a network
Replies: 6
Views: 5056

Re: Batch Ping a network

Steffen

Thank worked many thanks.

I tried to enter -a to resolve the address to the hostname but it doesn't appear in the output file?

Code: Select all

2>&1 ping %baserange%%%i -a -n  1 && (echo success) || (echo error)
can the hostname be resolved and be shown in the output file?
by Hooby1
03 Oct 2020 12:57
Forum: DOS Batch Forum
Topic: Batch Ping a network
Replies: 6
Views: 5056

Re: Batch Ping a network

Steffen Many thanks for this. I did a search but after finding and trying some out they were slightly different to what I was after. I have copied the code and made the change to: set "baserange=123.134.145." to my network IP address. I then ran the batch file and entered 0 at the first prompt and 2...
by Hooby1
03 Oct 2020 10:57
Forum: DOS Batch Forum
Topic: Batch Ping a network
Replies: 6
Views: 5056

Batch Ping a network

In cmd I use ping -a <ipaddress> to ping computers on a network but I do each IP individually which is very time consuming. Is it possible via a batch where the user can input the start and end IP address of the range to check and if the ping has a reply, write that to a text file and if it fails to...
by Hooby1
03 Oct 2020 10:44
Forum: DOS Batch Forum
Topic: Searching via batch
Replies: 4
Views: 4635

Re: Searching via batch

Steffen

Brilliant, thanks for that.

Much appreciated :D
by Hooby1
03 Oct 2020 07:28
Forum: DOS Batch Forum
Topic: Searching via batch
Replies: 4
Views: 4635

Re: Searching via batch

Steffen

Amazing, this is exactly what I was trying to do.
However, is it possible to show a count of how many files have been found? First on the screen and then written to the log file?
by Hooby1
02 Oct 2020 03:02
Forum: DOS Batch Forum
Topic: Searching via batch
Replies: 4
Views: 4635

Searching via batch

Hi Within Windows I can use the search facility and I enter part of the filename I require and it shows a list of the location(s) of the file(s) (sometimes using the wildcard option if I don't know the full filename). Is it possible to run a batch where it either prompts the user for part of the fil...
by Hooby1
01 Oct 2020 10:16
Forum: DOS Batch Forum
Topic: Search and delete via batch
Replies: 9
Views: 7891

Re: Search and delete via batch

Steffen

My mistake. You're right it does do sub folders. I didn't change the line - set "root=C:\Temp\" to the folder after I tested it on my first folder (without any sub folders) I then added a dummy file in but in a different folder :roll:
by Hooby1
01 Oct 2020 09:34
Forum: DOS Batch Forum
Topic: Search and delete via batch
Replies: 9
Views: 7891

Re: Search and delete via batch

Steffen Many thanks for that. I have tested it and it works. However, is it possible to scan through folders and sub folders? Apologies in my original post I said a single folder but after looking into it there is another folder within that. When I ran the batch it works on that folder but not on an...
by Hooby1
01 Oct 2020 07:59
Forum: DOS Batch Forum
Topic: Search and delete via batch
Replies: 9
Views: 7891

Search and delete via batch

Is it possible to search and delete files running a batch file that contain a certain character in the filename and an extension? For example I have 2 folders (docs and backup). Within windows I would use search and search for ~*.tmp and that would search for file names with a ~ and the extension en...