Search found 52 matches

by Rekrul
2023-Feb-05, 8:22 am
Forum: Windows CMD Shell
Topic: Putting the output of Tasklist into a variable?
Replies: 4
Views: 5706

Re: Putting the output of Tasklist into a variable?

Try running tasklist /nh /v /fi "WINDOWTITLE eq Untitled - Notepad" 1>demo.txt and see if that puts the message into the file, if not it may be using the error stream, so try it with 2>demo.txt You're correct, it's using the error stream. I tried Googling this, but didn't find anything he...
by Rekrul
2023-Feb-04, 9:18 pm
Forum: Windows CMD Shell
Topic: Putting the output of Tasklist into a variable?
Replies: 4
Views: 5706

Re: Putting the output of Tasklist into a variable?

When I run your code it returns INFO: The first token from the FOR command, which is what I'd expect, if you arent getting that, then something else is going on. The only difference I can think of is that I'm running it on an old XP system. Still, it seems like it should work. No matter what I try,...
by Rekrul
2023-Feb-04, 9:27 am
Forum: Windows CMD Shell
Topic: Putting the output of Tasklist into a variable?
Replies: 4
Views: 5706

Putting the output of Tasklist into a variable?

I'm trying to use the Tasklist command to find out if a particular window is open. Unfortunately, it only seems to work if the window is open. If it's not, the whole thing fails. Here is the simplest example; @echo off Set Results= For /f %%A in ('tasklist /nh /v /fi "WINDOWTITLE eq Untitled - ...
by Rekrul
2022-Dec-19, 6:44 am
Forum: Windows CMD Shell
Topic: Read a file, output each line to a new file, preserve all characters?
Replies: 8
Views: 6677

Re: Read a file, output each line to a new file, preserve all characters?

Hmm, I thought I saved my reply... Anyway, thanks for replying. An approach I have used is to replace all the problem characters with something else, either a character like ~ or ` use a unique phrase "Gr33nTreez" Then do all your processing and then rename the characters back to what they...
by Rekrul
2022-Dec-19, 2:54 am
Forum: Windows CMD Shell
Topic: Will all versions of Windows ignore a lone caret on the command line?
Replies: 4
Views: 10495

Re: Will all versions of Windows ignore a lone caret on the command line?

If you have a caret at the end of a line, that can have the effect of escaping the CR at the end of the line, which may have undesirable effects depending what is on the next line. I'll just have to be careful that it's never at the end of a line. It involves writing more code, but I would prefer t...
by Rekrul
2022-Dec-18, 1:45 pm
Forum: Windows CMD Shell
Topic: Read a file, output each line to a new file, preserve all characters?
Replies: 8
Views: 6677

Read a file, output each line to a new file, preserve all characters?

I'm trying to write a script that will read a given file line by line and output each one to a new file. I want to do this, so that the script can make some conditional changes to some of the lines. It should be a simple process, but of course it's not because Batch is the most ass-backward, convolu...
by Rekrul
2022-Dec-16, 12:56 am
Forum: Windows CMD Shell
Topic: Will all versions of Windows ignore a lone caret on the command line?
Replies: 4
Views: 10495

Will all versions of Windows ignore a lone caret on the command line?

As the title says, will all versions of Windows ignore a lone caret on the command line, not physically next to anything else? The reason I want to know is that the caret is the only thing I could think of to use as a placeholder for a missing command on a command line. Let's say that you have a scr...
by Rekrul
2022-Dec-16, 12:24 am
Forum: Windows CMD Shell
Topic: FTYPE reports wrong executable file
Replies: 6
Views: 3952

Re: FTYPE reports wrong executable file

Is the behaviour the same after a reboot? Sometimes a restart will reset things. Yes, always the same results. On the MPC website they have: July 16, 2017 XhmikosR v1.7.13, the latest, and probably the last release of our project… So it is possible that whatever method they use to set file associat...
by Rekrul
2022-Nov-02, 9:04 am
Forum: Windows CMD Shell
Topic: FTYPE reports wrong executable file
Replies: 6
Views: 3952

Re: FTYPE reports wrong executable file

A file type is not the same as a file extension, more than one file extension can be associated with the same File Type. FTYPE predates all of the recent changes and so I think it just displays whatever File Types it can see setup in the registry. What does ASSOC .avi return on your system? https:/...
by Rekrul
2022-Nov-01, 6:23 am
Forum: Windows CMD Shell
Topic: FTYPE reports wrong executable file
Replies: 6
Views: 3952

Re: FTYPE reports wrong executable file

I have updated the FTYPE page with some additional details about this, to make changes now requires applying a hash algorithm so generally has to be applied via group policy. Interesting, but that doesn't explain what's going on in my case. FTYPE is supposed to tell you what executable file a parti...