alt.msdos.batch
  Home FAQ Contact Sign in
alt.msdos.batch only
 
Advanced search
September 2008
motuwethfrsasuw
1234567 36
891011121314 37
15161718192021 38
22232425262728 39
2930      40
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
alt.msdos.batch Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Batch - compare and insert text         


Author: sandog
Date: Sep 19, 2008 14:27

This is what I'm trying to do. I want to look in a file and see if it
has the line "SSL=0". If it already contains that line, then do
nothing. If it doesn't contain that line, then add "SSL=0".
I have 2 batch scripts. The 1st checks for the string SSL=0 in a file.
The 2nd one adds SSL=0 following the string [Application Info].

In the the 1st batch file I set a constant to SSL=0. Then it searches
the file for SSL=0, and if it finds it, it assigns SSL=0 to a
variable.
Then it compares the constant and variable. If they are the same then
it echo's "SSL=0 already exists. If they are different then it runs
the 2nd second batch script which adds the line SSL=0. The problem I
am having is that even when the 2 are equal (SSL=0 == SSL=0), it's not
seeing them as equal.
The batch scripts are below. Thanks for any help.

1st script
@echo OFF

set sslcompare=SSL=0

rem -- seeing if the file has the word SSL=0 in it & putting it in
avariable to test against
Show full article (1.42Kb)
2 Comments
  Detectar unidad USB - Detect unit USB         


Author: Bernardo Canales
Date: Sep 17, 2008 13:30

Sorry for write in spanish

Necesito generar un batch que me permita detectar en que unidad o
letra esta el disco USB conectado al PC.
es posible ???

Gracias

sorry by my poor english

I need you a batch what me detect letter of disk USB connect to my PC
is possible ??

Thanks
3 Comments
  Windows XP - Use a Variable within a Variable.         


Author: Richhall
Date: Sep 17, 2008 08:02

Hi

I want to be able to use a user defined variable to then call a
previously set variable based on the value entered by the user. Is
this possible?

e.g I have variables

set IP0 xxx.xx.xx.xxx
set IP1 xxx.xx.xx.xxx
set IP2 xxx.xx.xx.xxx
set IP3 xxx.xx.xx.xxx
set IP4 xxx.xx.xx.xxx

If the user is prompted for a number

set /p NO=Enter Workstation Number: - user enters 4

set TEMP=IP%%NO%% - so this is now IP4

How do I now get it to use variable IP4?

i.e
copy \\%%IP4%%\\logs .........

As if I do copy \\%%temp%%\\logs it goes to IP4 not the IP address.
I can get the IP address into a text file:
Show full article (1.00Kb)
3 Comments
  Set var - system time + 30 seconds         


Author: mcse
Date: Sep 16, 2008 13:53

Hi, I need to add schedule task through batch file sting it to run in
30 seconds
6 Comments
  Replace string in environment variable         


Author: acb
Date: Sep 16, 2008 07:23

Hi,

I have an environment variable that contains a directory with spaces
in it (e.g. C:\Documents And Settings\My Pictures\whaterver. I need to
convert this as follows: C:\Documents\040And\040Settings\My\040Pictures
\whaterver.

I need this for the etc\fstab file.

Can anyone suggest a batch file script that will allow me to do this.

Thank You,
Al
2 Comments
  syntax %%date:~6,4%% and %%time:~6,2%%         


Author: Wilfrid
Date: Sep 15, 2008 07:59

Hi,
I am trying to understand the use of %%date:~6,4%% and %%time:~6,2%% in a ren
command.
What is the meaning of ~6,4, I beleive these are position on a certain
amount of character (?) but without certainty.
I am on XP with regional settings in UK.
Thanks in advance for your help
4 Comments
  batch command         


Author: Chuck
Date: Sep 12, 2008 07:10

Good day ladies and gentlemen. I have a quick batch question for you.
I have a number of files in the format
2003B1-Rev-2
2033B1-Rev-3
2066C1-Rev-1

and I would like to truncate the names thus:
2003-Rev-2
2033-Rev-3
2066-Rev-1

I've tried a number of command variations.
My latest being:
ren ??????-Rev-?.pdf ????-Rev-?.pdf

Now I get this:
2003-Rev-v.pdf
2033-Rev-v.pdf
2066-Rev-v.pdf

What is the correct command for this please?
5 Comments
  SET error         


Author: John Croson
Date: Sep 11, 2008 07:29

This worked for me yesterday, and now doesn't.... Does anyone have any
idea as to why my variable %%FILE%% remains empty? %%%%f does contain a
file name....

SET TODAY=%%DATE:~4,2%%%%DATE:~7,2%%
FOR /F %%%%f IN ('DIR /B *ERUP*.PGP') DO (
SET FILE=%%%%f
SET FDATE=%%FILE:~6,4%%
IF NOT %%FDATE%%==%%TODAY%% SET MSG=The date of the files do not match.
--- FILE DATE = %%FDATE%%, RUN DATE = %%TODAY%% & GOTO SENDMAIL
)

TIA!
8 Comments
  make money online         


Author: gay
Date: Sep 7, 2008 20:44

click here..........
****************
*******************
http://homejobis.blogspot.com
***********************
******************
http://www.glittergraphicsnow.com/butterfly.html
no comments
  (List or Array(Unidimencional)) Date structure in time of execution         


Author: J Ivan P Silvestre
Date: Sep 7, 2008 04:41

Is true in bath dont exist list's or array's so I create the an
estructure with diferents method's just like a List in c#:

------------------------------------------------------------------------------
:List_add_value
set %%1=%%2,%%3
goto:EOF

:List_Return_Value_by_index
set count=0
if %%2 lss 0 (echo Index inexistent!!! & goto:EOF)
set lenght=0
call :List_Lenght %%1 lenght
if %%lenght%% lss %%2 (echo Index inexistent!!! & goto:EOF)
for %%%%k in (%%~1) do (if %%2 equ %%count%% (set %%3=%%%%k) else (set /a count
+=1) )
goto:EOF
Show full article (3.65Kb)
no comments
1 2 3 4 5 6 7 8 9