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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |