Thread Tools
Old February 8, 2003, 01:53   #1
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 09:56
Local Date: November 1, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Are Bat. files obsolete?
With increasing numbers of people 'upgrading' to Windows XP, there are more and more complaints about batch files not working. These are simple DOS based programs which copy and overwrite files in the main Civ directory and in the scenario folder, allowing changes in graphics, units, terrain and events.

It has been suggested that installing a file called "Choice" (see attached) will allow Bat. files to work with XP. While they will actually run with choice installed, they don't work the way they're supposed to. In fact, the more times you run them the more they screw up the files they're supposed to change back and forth.

So my question is whether or not anyone is able to come up with a solution, or whether Bat. files will be rendered obsolete?
Attached Files:
File Type: zip choice.zip (8.3 KB, 79 views)
__________________
Tecumseh's Village, Home of Fine Civilization Scenarios

www.tecumseh.150m.com
techumseh is offline  
Old February 8, 2003, 02:52   #2
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 11:56
Local Date: November 1, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
I don't know whats wrong with you people, it's not that hard to use a batch file and put choice in your scenario directory...
DarthVeda is offline  
Old February 8, 2003, 03:14   #3
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 09:56
Local Date: November 1, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Quote:
Originally posted by DarthVeda
I don't know whats wrong with you people, it's not that hard to use a batch file and put choice in your scenario directory...
What is it about "It doesn't work" that you don't get?
__________________
Tecumseh's Village, Home of Fine Civilization Scenarios

www.tecumseh.150m.com
techumseh is offline  
Old February 8, 2003, 09:52   #4
our_man
Civilization II Democracy Game: Red FrontScenario League / Civ2-Creation
Prince
 
our_man's Avatar
 
Local Time: 16:56
Local Date: November 1, 2010
Join Date: Oct 2000
Location: Glasgow, Scotland
Posts: 522


I've never had a problem running batch files under windows XP after installing choice.
our_man is offline  
Old February 8, 2003, 10:55   #5
Boco
Scenario League / Civ2-Creation
King
 
Boco's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: Jan 2001
Location: of underdogs
Posts: 1,774
Okay, before we ignite, let's debug a little. Here's a test for CHOICE.

This batch file works repeatedly on my XP machine, when CHOICE is called from a local directory.

Quote:
@echo off
cls
echo.
echo Please choose from the options below:
echo.
echo 1. Option 1
echo 2. Option 2
echo Ctrl-Break. Exit without Loading
echo.
choice /c:12 Enter your selection

if errorlevel 2 goto Opt2
if errorlevel 1 goto Opt1

:Opt1
echo Opt1
goto done

:Opt2
echo Opt2
goto done

:done
echo.
pause
exit
So now I'm pretty sure that CHOICE.COM isn't the problem, at least when called from the local directory. I'll test some more when I have a chance. From your other posts, Tech, I'd suspect the copy portion of the batch file is at fault.

Even so, BAT files are obsolete. I just don't know of anything better.
Boco is offline  
Old February 8, 2003, 11:51   #6
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 11:56
Local Date: November 1, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
I've had WindowsXP for the last year and a half, and have never had a major problem with batch files as long as choice.com was installed and properly working. There are two places to install it:

1. In the scenario directory (this is a temporary fix and will work only for this scenario)
2. In the windows System32 directory. This will fix it until you reformat.

I've had the occassional glitch where a rules file doesn't copy for some reason but that is 1 in about 500 sessions that happens.
DarthVeda is offline  
Old February 8, 2003, 12:14   #7
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 09:56
Local Date: November 1, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
I've had XP installed for the best part of a year on my D drive. I kept Win98 on the C drive, though I just use the XP. I'm specifically referring to the Bat. files in Red October. It includes a bat. file which changes the dialog and city files and 3 .dll files in the main ToT directory.

It works fine in Win98; never had a problem. It doesn't work at all in XP. Here's the screen I get. If I'm doing something wrong, please tell me.
Attached Thumbnails:
Click image for larger version

Name:	bat.gif
Views:	302
Size:	12.0 KB
ID:	36294  
__________________
Tecumseh's Village, Home of Fine Civilization Scenarios

www.tecumseh.150m.com
techumseh is offline  
Old February 8, 2003, 12:33   #8
H Tower
Civilization II Democracy Game: ExodusScenario League / Civ2-CreationCivilization II Democracy Game: Red FrontCivilization II Democracy GameNationStates
 
H Tower's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: Jul 2001
Posts: 6,135
i'm new to xp, so i've never heard of choice, i'll have to go check this out if it really works
H Tower is offline  
Old February 8, 2003, 13:05   #9
Boco
Scenario League / Civ2-Creation
King
 
Boco's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: Jan 2001
Location: of underdogs
Posts: 1,774
Tech, you're onto something. XP enforces a rule that presumably Win98 doesn't. XP requires a second argument for CHOICE.COM after the /Cyx in RO's Restore.bat. When I appended "Enter your selection", it worked okay on my XP. If it's not there, the result isn't pretty. A line of abnormal characters is displayed.

The pertinent 'code' with the change underlined.

Quote:
:echo off
echo This procedure restores ToT graphic files to their previous state.
echo -
echo DISCLAIMER: You run this procedure at you own risk.
echo -
echo Press y to continue
echo Press x to exit
choice /C:yx Enter your selection
IF errorlevel 2 goto abort
etc.
Two panels attached: top, no 2nd string; bottom, 2nd string present.
Attached Thumbnails:
Click image for larger version

Name:	ro restore error msg.png
Views:	296
Size:	11.3 KB
ID:	36304  
Boco is offline  
Old February 8, 2003, 16:07   #10
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 09:56
Local Date: November 1, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Thanks, though I'm not sure I understand it. I see the C drive referenced in your new line. Could that fact that I've moved everything to the D drive have also affected this?
__________________
Tecumseh's Village, Home of Fine Civilization Scenarios

www.tecumseh.150m.com
techumseh is offline  
Old February 8, 2003, 16:11   #11
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 11:56
Local Date: November 1, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
No. /C is a switch. It has absolutely nothing to do with what drive the program or the scenario is located.
DarthVeda is offline  
Old February 8, 2003, 17:35   #12
Boco
Scenario League / Civ2-Creation
King
 
Boco's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: Jan 2001
Location: of underdogs
Posts: 1,774
Quote:
I see the C drive referenced in your new line. Could that fact that I've moved everything to the D drive have also affected this?
No, I'm pretty sure that as long as CHOICE.COM is either in the local drive or the path (usually c:\Windows\System32 and c:\Windows) you're okay. Otherwise the error message would be different.

Looks like you already understand how to use the /C switch that DV's referring to.

Simply put some text after the "/Cyx" argument. It can be multiple words, though there's undoubtedly a limit on total length (64 characters?, 128?). As long as there's a space between "/Cyx" and the new text, it ought to work.

What you've shown in RO is that W98 doesn't care whether the additional text is there or not. With WXP, however, that bit of text after "/Cyx" (where y and x are the keys that the user uses to reply) appears to be absolutely essential. 'Sfunny the bugs that a new OS can bring out of an old program.
Boco is offline  
Old February 8, 2003, 18:59   #13
mordhiem
Civilization II PBEM
Warlord
 
mordhiem's Avatar
 
Local Time: 15:56
Local Date: November 1, 2010
Join Date: Mar 2002
Location: Newbury, UK
Posts: 105
Hooray! A reason to not have XP. Maybe I won't spend the (ridiculous) 100+ quid to upgrade...
mordhiem is offline  
Old February 8, 2003, 19:11   #14
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 11:56
Local Date: November 1, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
You were going to pay for that?
DarthVeda is offline  
Old February 8, 2003, 23:03   #15
St Leo
Scenario League / Civ2-CreationApolytoners Hall of Fame
 
St Leo's Avatar
 
Local Time: 11:56
Local Date: November 1, 2010
Join Date: Jul 2005
Location: In search of pants
Posts: 5,085
Friends don't let friends pirate Microsoft programmes.
__________________
Blog | Civ2 Scenario League | leo.petr at gmail.com
St Leo is offline  
Old February 9, 2003, 11:38   #16
ottok
Prince
 
ottok's Avatar
 
Local Time: 15:56
Local Date: November 1, 2010
Join Date: Oct 1999
Location: tampere,FINLAND
Posts: 550
BAT LIFE CONTINUESILLY!?
ottok is offline  
Old February 9, 2003, 20:21   #17
ravagon
Scenario League / Civ2-Creation
King
 
Local Time: 23:56
Local Date: November 1, 2010
Join Date: Sep 1999
Location: Australia
Posts: 1,515
Quote:
Originally posted by St Leo
Friends don't let friends pirate Microsoft programmes.
Rather - Friends should warn friends about using Microsoft programmes - period.

Having had my fill of XP I'm now thinking of upgrading to W98...
ravagon is offline  
Old April 27, 2003, 07:29   #18
Angelo Scotto
Scenario League / Civ2-Creation
Warlord
 
Local Time: 15:56
Local Date: November 1, 2010
Join Date: Oct 1999
Location: Milan, Italy
Posts: 127
Re: Are Bat. files obsolete?
Quote:
Originally posted by techumseh
So my question is whether or not anyone is able to come up with a solution, or whether Bat. files will be rendered obsolete?
Batch files are obsolete, but they were already obsolete several years ago:
When Microsoft started designing Win95 it was clear that old DOS batch files were not flexible enough to work with the new OSes.
So they developed the "Windows Script Host" as a kind of Windows Batch Files, Win98 was the first OS of the Windows family to have WSH embedded but it is also present in ME,NT and XP operating systems.
So, in fact, the solution for post-batch era is already on your computer
You can download latest WSH version (5.6 i think) from Microsoft at http://msdn.microsoft.com/scripting
but if you've XP you should already have it, just download the documentation.
To discover which WSH version you've installed open a DOS Prompt and write "cscript" it should print the WSH header containing the version number.

I'm trying to attach (let's hope i succeed...) two versions of Boco example, one in JScript (the Microsoft version of JavaScript)
and the other in VBScript (a macro language based on Visual Basic).
I personally prefer JScript syntax but VBScript probably is more similar to DOS Batch files.
To try them open a DOS prompt, move to the directory where you downloaded the scripts, and launch the interpreter writing "cscript BatsAreObsolete.js" or "cscript BatsAreObsolete.vbs".
Unfortunately you can't simply double click on them because doing so you will launch the WScript (Windows Parser) instead of CScript (Console parser, will work in a DOS Prompt windows) but you can create a single-line BAT file (funny isn't it? ) containing the line: "cscript scriptfilename" just to launch the console parser.

IMHO WSH is really more powerful than old DOS Batch files because, for example, you can rewrite the code of my example to work with WScript instead of CScript, showing windows and dialog boxes to the final user instead of few lines on a terminal screen, without talking about features of jscript or vbscript which are (almost...) real programming languages, and, last but not least, they can interact and use ActiveX objects and this opens endless possibilities (if someone is so crazy to start writing a couple of "ScenarioLeague's" ActiveX components...)

Greetings,
Angelo
Attached Files:
File Type: zip batsareobsolete.zip (942 Bytes, 20 views)
__________________
"If it works, it's obsolete."
-- Marshall McLuhan
Angelo Scotto is offline  
Old April 27, 2003, 09:43   #19
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 09:56
Local Date: November 1, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
It's good to have you back, Angelo.
__________________
Tecumseh's Village, Home of Fine Civilization Scenarios

www.tecumseh.150m.com
techumseh is offline  
Old April 27, 2003, 09:44   #20
Boco
Scenario League / Civ2-Creation
King
 
Boco's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: Jan 2001
Location: of underdogs
Posts: 1,774
This I've got to check out. Thanks! Vscript is (almost) within my ability!
Boco is offline  
Old April 27, 2003, 09:51   #21
Henrik
Civilization II PBEMScenario League / Civ2-CreationNationStatesMacCivilization II Democracy Game: Red FrontSpanish CiversCivilization IV Creators
Emperor
 
Henrik's Avatar
 
Local Time: 16:56
Local Date: November 1, 2010
Join Date: Dec 2000
Location: The European Union, Sweden, Lund
Posts: 3,682
Would those Jscripts be compatible with macs (as normal java scripts are)?
__________________
No Fighting here, this is the war room!
Henrik is offline  
Old April 28, 2003, 15:48   #22
Angelo Scotto
Scenario League / Civ2-Creation
Warlord
 
Local Time: 15:56
Local Date: November 1, 2010
Join Date: Oct 1999
Location: Milan, Italy
Posts: 127
Quote:
Originally posted by techumseh
It's good to have you back, Angelo.
And it's good to be here again techumseh

Quote:
Originally posted by Henrik
Would those Jscripts be compatible with macs (as normal java scripts are)?
Well, this is an interesting question.

I'm extremely ignorant about Mac things so correct me if i'm going to write something obviously wrong:

From personal experience JScript share the same syntax of JavaScript, maybe there are some differences but i've never stumbled on them and for our task of emulating old batch files i don't think we'll stumble on them too.

The differences are, obviously, in the WSH side and on the objects it exposes.

While in Windows there is a WScript object to manage all, in Mac (i'm talking about JavaScriptOSA implementation) you have a MacOS object.

So, the language is probably the same but the objects on which it operates aren't.

This problem could be solved in an easy way, but it remains a problem that made argue with MacOS several times in the past: Where on the hell is the Shell?
I know that since MacOSX the Mac OS is heavily based on UNIX, so it now has a Shell but looking at the JavaScriptOSA homepage (http://www.latenightsw.com/freeware/JavaScriptOSA/) i was unable to find a command to write a line of text to a Unix Shell or to read the user answer from that shell.

If you're able to find a way to write and read data from the shell using JavaScript then the other things can be easily solved and you'll have a way to execute directly JScript files under Mac otherwise...

I've found this old webpage of the Mozilla project (http://www.mozilla.org/status/1999-9-17.html) which say:
"Waldemar has also made the stand-alone JavaScript shell work as a Macintosh MPW tool."
I've no idea what a MPW tool is, anyway the word Javascript near the word shell seems a promising starting point, you could check if current version of Mozilla for macintosh comes with a JavaScript Shell.

Unfortunately keep in mind that probably VBScript will be the choice of the majority of designers since it resembles DOS Batch files and there's no simple way to port it to the Mac.
__________________
"If it works, it's obsolete."
-- Marshall McLuhan
Angelo Scotto is offline  
Old January 17, 2004, 15:46   #23
Berzerker
Civilization II MultiplayerApolytoners Hall of Fame
Emperor
 
Berzerker's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: May 1999
Location: topeka, kansas,USA
Posts: 8,164
Ugh, I hate to bother you guys but how do I follow Angelo's instructions for microsoft scripting? I'm very computer illiterate and need my hand held going thur this. I have XP but don't know where to put the dl or documentation.
Berzerker is offline  
Old January 17, 2004, 15:58   #24
Berzerker
Civilization II MultiplayerApolytoners Hall of Fame
Emperor
 
Berzerker's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: May 1999
Location: topeka, kansas,USA
Posts: 8,164
Btw, I tried the choice.com thing and the only way it worked was when I put it into the specific scenario and then I could select a civ to play but the game crashed the moment I loaded the scenario so I'm back at step 1
Berzerker is offline  
Old January 17, 2004, 16:07   #25
yaroslav
Civilization II MultiplayerCivilization II PBEMSpanish CiversCivilization II Democracy Game: ExodusScenario League / Civ2-CreationApolytoners Hall of Fame
Emperor
 
yaroslav's Avatar
 
Local Time: 16:56
Local Date: November 1, 2010
Join Date: Jun 2001
Location: Madrid, Spain, Europe
Posts: 7,795
Berzeker, from your last post I guess you did it well - can you tell what scen was it, what civ did you select?
__________________
Trying to rehabilitateh and contribuing again to the civ-community
yaroslav is offline  
Old January 17, 2004, 16:19   #26
Berzerker
Civilization II MultiplayerApolytoners Hall of Fame
Emperor
 
Berzerker's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: May 1999
Location: topeka, kansas,USA
Posts: 8,164
Seeds of Greatness, babylonians. I put choice in that scenario and finally got the dos prompt to stay up instead of disappearing right away but when I went to start the scenario after choosing the babs the game would go to the title screen and crash
Berzerker is offline  
Old January 17, 2004, 16:30   #27
Berzerker
Civilization II MultiplayerApolytoners Hall of Fame
Emperor
 
Berzerker's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: May 1999
Location: topeka, kansas,USA
Posts: 8,164
oh, civ 2 mge also. I see Tecumseh is on ToT
Berzerker is offline  
Old January 17, 2004, 16:38   #28
yaroslav
Civilization II MultiplayerCivilization II PBEMSpanish CiversCivilization II Democracy Game: ExodusScenario League / Civ2-CreationApolytoners Hall of Fame
Emperor
 
yaroslav's Avatar
 
Local Time: 16:56
Local Date: November 1, 2010
Join Date: Jun 2001
Location: Madrid, Spain, Europe
Posts: 7,795
I can't clone the problem - it's working fine for me

At what point do the game actually crash? Do you have the same problem with the other civs?
__________________
Trying to rehabilitateh and contribuing again to the civ-community
yaroslav is offline  
Old January 17, 2004, 19:16   #29
Berzerker
Civilization II MultiplayerApolytoners Hall of Fame
Emperor
 
Berzerker's Avatar
 
Local Time: 10:56
Local Date: November 1, 2010
Join Date: May 1999
Location: topeka, kansas,USA
Posts: 8,164
Yes, all civs act that way. And it crashes at the title picture, the graphics screen for the game.
Berzerker is offline  
Old January 17, 2004, 21:41   #30
POTUS
Civilization II Democracy Game: ExodusMacCivilization II PBEMScenario League / Civ2-Creation
Prince
 
POTUS's Avatar
 
Local Time: 07:56
Local Date: November 1, 2010
Join Date: Jul 2003
Location: How could I possibly not have a Mozambican flag, I mean, what other country has an AK-47 on their flag?
Posts: 564
Java Scripts work on OS X, but you need to remember that Macs use *.pict, not gifs or bmps.
__________________
Vote Democrat
Support Democracy
POTUS is offline  
 

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 11:56.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team