I am writing a scripts/aliases to write all passwords into a txt file and getting the text from the batch file.
My addpwd alias looks like: @echo %$ >> gpp1test.txt
My getpwd alias looks like: grep -i %$ gpp1test.txt
All is fine if I stop at this. When I type getpwd, the password is displayed, when I copy this from the console and paste into password fields in web, everything is fine.
The problem occurs when I try to copy the password into clipboard in a batch file.
The copy works, but when I paste, it also inserts one extra character into the clipboard. (I have to delete the last character manually to make it work)
I checked using clipspy, an external utility. This is how it shows up. (See attached image)
The one with blue tint are the images of clipboard where the text was copied to clipboard using "type ... > clip:" command. (That is what happens when I type "gpp1.bat all@")
The one with no tint are the ones when I mark the text on console and press enter. This is the one that works fine.
My gpp1.bat is the batchfile where I am trying to copy the password to clipboard, and looks like this:
@echo off
set gpptmpFile=%@UNIQUE[%tmp%]
del /q %gpptmpFile%
for /f "tokens=*" %a in ('grep -i %$ c:\gpp1test.txt') echo "%a" >> %gpptmpFile%
iff %@lines[%gpptmpFile%] ge 0 then
setdos /x-5
echo %@field[" :^"",-1,%@line[%gpptmpFile%,0]] > %gpptmpFile%.1
type %gpptmpFile%.1 > clip:
type %gpptmpFile%.1
del /q %gpptmpFile%.1
setdos /x0
else
echo Error: %@lines[%gpptmpFile%] lines in %gpptmpFile%
endiff
del /q %gpptmpFile%
My gpp1test.txt file is created using notepad++ and looks like this:
[email protected]: 4Something##&
another password: somethingElse%$#
One more: password!
Anyone has came across this problem when using clip:
I am on 32 bit intel based Windows vista.
Attached Images
My addpwd alias looks like: @echo %$ >> gpp1test.txt
My getpwd alias looks like: grep -i %$ gpp1test.txt
All is fine if I stop at this. When I type getpwd, the password is displayed, when I copy this from the console and paste into password fields in web, everything is fine.
The problem occurs when I try to copy the password into clipboard in a batch file.
The copy works, but when I paste, it also inserts one extra character into the clipboard. (I have to delete the last character manually to make it work)
I checked using clipspy, an external utility. This is how it shows up. (See attached image)
The one with blue tint are the images of clipboard where the text was copied to clipboard using "type ... > clip:" command. (That is what happens when I type "gpp1.bat all@")
The one with no tint are the ones when I mark the text on console and press enter. This is the one that works fine.
My gpp1.bat is the batchfile where I am trying to copy the password to clipboard, and looks like this:
@echo off
set gpptmpFile=%@UNIQUE[%tmp%]
del /q %gpptmpFile%
for /f "tokens=*" %a in ('grep -i %$ c:\gpp1test.txt') echo "%a" >> %gpptmpFile%
iff %@lines[%gpptmpFile%] ge 0 then
setdos /x-5
echo %@field[" :^"",-1,%@line[%gpptmpFile%,0]] > %gpptmpFile%.1
type %gpptmpFile%.1 > clip:
type %gpptmpFile%.1
del /q %gpptmpFile%.1
setdos /x0
else
echo Error: %@lines[%gpptmpFile%] lines in %gpptmpFile%
endiff
del /q %gpptmpFile%
My gpp1test.txt file is created using notepad++ and looks like this:
[email protected]: 4Something##&
another password: somethingElse%$#
One more: password!
Anyone has came across this problem when using clip:
I am on 32 bit intel based Windows vista.
Attached Images