A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Security and Administration with Windows XP
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

batch file



 
 
Thread Tools Display Modes
  #1  
Old December 20th 05, 03:39 PM posted to microsoft.public.windowsxp.security_admin
external usenet poster
 
Posts: n/a
Default batch file

I'm trying to write a batch file, but I want to make it as readable as
possible for future edits. I have a lot of if statements in a for loop and
it only works if I put it on one line. Otherwise I get the error "0 was
unexpected at this time" during a simple == comparison. What are the spacing
rules for batch files? Can you not space it such as:
if %_yestermonth% equ 2 (
set /a _yesterday=%_yesterday% + 1
)

?

Thanks ahead of time for any help on the subject.
Ads
  #2  
Old December 20th 05, 05:22 PM posted to microsoft.public.windowsxp.security_admin
external usenet poster
 
Posts: n/a
Default batch file


No. Batch files don't support continuation of lines.

If you're doing something more than a simple task you might be better to
look at a 'real' scripting language. There are several good free ones, for
example VBScript which comes with Windows, AutoIt or KixStart.


  #3  
Old December 20th 05, 05:29 PM posted to microsoft.public.windowsxp.security_admin
external usenet poster
 
Posts: n/a
Default batch file

From: "Ian"

|
| No. Batch files don't support continuation of lines.
|
| If you're doing something more than a simple task you might be better to
| look at a 'real' scripting language. There are several good free ones, for
| example VBScript which comes with Windows, AutoIt or KixStart.
|

KiXtart is highly recommended !

http://kixtart.org KiXtart is CareWare.

--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm


  #4  
Old December 21st 05, 09:54 AM posted to microsoft.public.windowsxp.security_admin
external usenet poster
 
Posts: n/a
Default batch file

On Tue, 20 Dec 2005 07:39:07 -0800, cwtrex
wrote in
microsoft.public.windowsxp.security_admin:

I'm trying to write a batch file, but I want to make it as readable as
possible for future edits. I have a lot of if statements in a for loop and
it only works if I put it on one line. Otherwise I get the error "0 was
unexpected at this time" during a simple == comparison. What are the spacing
rules for batch files? Can you not space it such as:
if %_yestermonth% equ 2 (
set /a _yesterday=%_yesterday% + 1
)


AFAIK a "^" can be used to continue lines under CMD.EXE. Try this:

if %_yestermonth% equ 2 ( ^
set /a _yesterday=%_yesterday% + 1 ^
)

PS: A more descriptive Subject: line and a more appropriate newsgroup
might have elicited more useful responses.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows update for KB896358 doesnot install Shafeeq-LSHTM General XP issues or comments 4 July 27th 05 06:37 PM
explorer only works if I rename it Dave Sell General XP issues or comments 7 June 3rd 05 01:33 PM
Can't install Critical Update for Windows XP Media Center Edition2004 (KB838358) Ant General XP issues or comments 7 May 19th 05 03:21 AM
Can't install Critical Update for Windows XP Media Center Edition2004 (KB838358) Ant Windows XP Help and Support 7 May 19th 05 03:21 AM
Help please with VX2, IGETNET, ugroup and popups Mctabish Windows XP Help and Support 3 December 16th 04 12:35 AM






All times are GMT +1. The time now is 02:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.