Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strings.com in Win9X/ME/NT/XP...

1 view
Skip to first unread message

Benny Pedersen

unread,
Jun 19, 2002, 10:13:19 AM6/19/02
to

Hi,

I got many mails from all over the world concerning
the use of Strings.com in XP.
Maybe someone can see the idea about prefixing lines in
a previous constructed program? Something like this,

Benny Pedersen,

@echo off %[This line must be line num 1 with no blank line(s) above]%
Rem: Strings.com in Win9X/ME/NT/XP...
Rem: To see how it works with the old/bad "Strings.com" instead of the
Rem: substituted VBS file, prefix line num 3 with a double colon (::),

if not (%1)==() goto %1
%comspec% /c%0 vb>%temp%.\Strings.com.vbs.vbs Windows_NT
if not exist %temp%.\strings.com.vb* goto start (USING Strings.com)
if Windows_NT==%OS% %0 call wScript.exe %temp%.\ .vbs.vbs
%0 start.exe/wait wScript.exe %temp%.\ .vbs.vbs
:call
:start
%1 %2 %3strings.com%4 M = MONTH
%1 %2 %3strings.com%4 month = month

if %2.==wScript.exe. for %%c in (call del) do %%c %temp%.\~.bat
echo. Var [M] = [%M%]
echo. Var [Month] = [%Month%]
echo.--------------------------------------

%1 %2 %3strings.com%4 Date = Date
%1 %2 %3strings.com%4 T = That > nul

if %2.==wScript.exe. for %%c in (call del) do %%c %temp%.\~.bat
echo. Var [Date] = [%Date%]
echo. Var [T] = [%T%]
echo. Var [M] = [%M%]
echo.

for %%I in (M Month Date T) do set %%I=
for %%I in (pause cls goto:EOF) do %%I.
:vb
echo Dim obj,arg:set obj=wscript.createObject("wScript.shell")
echo set arg=wScript.arguments:if not arg.count=3then wScript.quit
echo select case lcase(arg(2)):case"month" obj.run"%%comSpec%% /c"_
echo +"echo set "+arg(0)+"="+ucase(left(monthName(month(now)),1))_
echo +mid(monthName(month(now)),2)+">>%%temp%%.\~.bat",0,1
echo case"date"obj.run"%%comSpec%% /cEcho set "+arg(0)+"="+mid("Jan"_
echo +"uary%%--%%February%%-%%March%%----%%April%%----%%May%%------"_
echo +"%%June%%-----%%July%%-----%%August%%---%%September%%%%October"_
echo +"%%--%%November%%-%%December%%-%%",11*month(now)-10,11)+" "_
if not %2.==%OS%. echo &day(now)&", "&year(now)&">>%%temp%%.\~.bat",0,1
if %2 == %OS% echo ^&day(now)^&", "^&year(now)^&">>%%temp%%.\~.bat",0,1
echo case else msgBox vbCr+"No implementation of: "+vbTab+vbCr+vbCr _
echo +arg(2)+vbCr,16
echo end select
:EOF


Phil Robyn

unread,
Jun 19, 2002, 1:25:45 PM6/19/02
to
Benny Pedersen wrote:
>
> Hi,
>
> I got many mails from all over the world concerning
> the use of Strings.com in XP.
> Maybe someone can see the idea about prefixing lines in
> a previous constructed program? Something like this,
>
> Benny Pedersen,

Hi, Benny:

Here is a 'helper' for STRINGS.COM for WinNT4.0, Win2000, WinXP:

=====begin C:\cmd\TEST\XSTRING.CMD====================
01. @echo off
02. :: syntax: %~n0 [set (somevar)] COMMAND
03. ::
04. :: If you don't assign the result of a command to a variable, the
05. :: result will be displayed on the screen.
06. ::
07. :: (The following list of commands is not exhaustive; see STRINGS
08. :: documentation for additional information.)
09. ::
10. :: COMMAND RESULT
11. :: --------------------------------- -------------------------------
12. :: lastdrive D:
13. :: char 65, 66, 67, 68 ABCD
14. :: val Doug 68 111 117 103
15. :: ADDCOMMAS 12345678 12,345,678
16. :: filedate c:\cmd\test\xstring.cmd 06-07-2001
17. :: filetime c:\cmd\test\xstring.cmd 03:17:54 pm
18. :: filedir c:\cmd\test\xstring.cmd \CMD\TEST
19. :: filedrive c:\cmd\test\xstring.cmd c:
20. :: filename c:\cmd\test\xstring.cmd XSTRING
21. :: fileext c:\cmd\test\xstring.cmd CMD
22. :: linesize c:\cmd\test\xstring.cmd (lines in file-1 (off by 1))
23. :: truename test\xstring.cmd C:\CMD\TEST\XSTRING.CMD
24. :: codepage 437
25. :: country 1
26. :: biosdate 02/16/99
27. :: day Saturday
28. :: day 1 Sunday
29. :: day 2 Monday
30. :: date June 9, 2001
31. :: month June
32. :: month 1 January
33. :: time 01:17:02 pm
34. :: length now is the time 15
35. :: upper now is the time NOW IS THE TIME
36. :: lower NOW IS THE TIME now is the time
37. :: ....+....1....+
38. :: right now is the time, 8 the time
39. :: left now is the time, 8 now is t
40. :: mid now is the time, 5,8 is the t
41. :: FIND String, Findstring The position of Findstring in
42. :: String.
43. :: FINDC String, Findstring The position of Findstring
44. :: in String. Case sensitive.
45. :: read (filename), (line number) reads that line from the file
46. :: write (filename), (string) appends (string) to (filename)
47. :: repeat (number), (char) string of (that many chars)
48. :: parse abcd.efgh.ijkl.mnop, 3, . ijkl
49. :: getkey scan code and ASCII value of key
50. if [%1] NEQ [?] if [%1] NEQ [/?] if [%1] NEQ [] goto :begin
51. call XHELP %~f0
52. goto :EOF
53. :begin
54. setlocal
55. set cd=
56. set cmdline=%*
57. if defined cd set cmdline= %cmdline%
58. set parm1=%1
59. set parm2=%2
60. if /i "%1"=="set" (
61. set zvar=%2
62. call set cmdline=%%cmdline: %parm1% = %%%
63. call set cmdline=%%cmdline: %parm2% = %%%
64. )
65. for /f "tokens=* delims=" %%a in (
66. '"strings %cmdline%"') do set string=%%a
67. if defined zvar goto :assign
68. echo %string%
69. endlocal&goto :EOF
70. :assign
71. endlocal&set %zvar%=%string%&goto :EOF
=====end C:\cmd\TEST\XSTRING.CMD====================
=====begin C:\cmd\TEST\XHELP.CMD====================
01. @echo off
02. ::
03. :: Displays the contents of the 'flowerbox' in a CMD or BAT
04. :: file.
05. ::
06. :: '%~n0' will be displayed as the name of the referenced file
07. ::
08.
09. if {%1} NEQ {} if {%1} NEQ {?} if {%1} NEQ {/?} if /i {%1} NEQ {HELP} goto :begin
10. call XHELP %~f0
11. goto :EOF
12.
13. :begin
14. setlocal
15. set cd=
16. set whichfile=%1
17. for /f "tokens=*" %%a in (
18. 'dir %whichfile% ^| find "/"'
19. ) do set direntry=%%a
20. set fname=%~n1
21. echo :
22. echo : %direntry:~0,38% %whichfile%
23. echo :
24. for /f "tokens=* delims=" %%* in (
25. 'findstr /b /c:"::" %whichfile%') do call :display %%*
26. endlocal& goto :EOF
27. :display
28. set line=%*
29. set line=%line:~1%
30. if not defined cd set line=%line:~1%
31. call set line=%%line:^%~n0=%fname%%%
32. echo %line%
33. goto :EOF
34. :EOF
35.
=====end C:\cmd\TEST\XHELP.CMD====================

--
t o s e n d e - m a i l u s e ' R e p l y - T o '
o r u n z i p m y ' F r o m ' a d d r e s s ....

0 new messages