Tab characters pasted into CMD window

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mowmow
Posts: 4
Joined: 02 Nov 2009 18:43

Tab characters pasted into CMD window

#1 Post by mowmow » 03 Nov 2009 07:58

Hi again,

I have written a batch file that parses a simple cut/paste from a web browser window into the command window and then outputs the pertinent data in my desired format. The pasted data is taken in via the set /P function as shown here:

(BEGIN LOOP)
set /P INPUT1=:
(END LOOP)

What I've run into is that the pasted text can include TAB characters, which will behave just like pressing the TAB key when entering input into this function. That is, you will get a sequential (with each tab) entry for each filename that resides in the current directory. This of course trashes the input data. I am not sure if this is a funtion of Doskey or not, but what I'm looking for is a better way to circumvent this, such as disabling Doskey (if that's the cause) from within the batch file.

What I have done so far (which seems kind of marginal, but has worked) is to create an empty folder adjacent to the batch file, and the script CDs to it, thus disallowing any filenames from being entered via the TAB operation, since there are no files there. Anyone have a better solution?

Thanks,
Andy

mowmow
Posts: 4
Joined: 02 Nov 2009 18:43

#2 Post by mowmow » 05 Nov 2009 10:35

Another issue with my solution (which I just discovered after unmuting my audio) is that the tab characters result in a windows alert sound being played. So, pasting the page contents in the command window yields a burst of not-so-friendly alert sounds (not CTRL-G bell sounds FWIW).

Post Reply