.bat files help

Joined
Mar 1, 2007
Messages
53
Reaction score
0
Points
6
hey there guys...am currently developing a java project for uni and all the files provided to us are in a .bat (dos) extension. Anyone knows how to make the to work on a mac unix environment? something has to do with textedit i think....plz help
 
Joined
Mar 22, 2007
Messages
1,463
Reaction score
67
Points
48
Location
UK
Your Mac's Specs
Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
DOS batch files won't work in OSX/Unix, you'd have to rewrite them. They are text files so you can edit them with TextEdit, but be sure to save them as plain text, not RTF.
 
OP
L
Joined
Mar 1, 2007
Messages
53
Reaction score
0
Points
6
yeah i did that...i renamed them and then what?
i have to save them as plain text and?
run the with terminal?
 
Joined
Aug 4, 2007
Messages
302
Reaction score
8
Points
18
MAcs can run Unix commands and can be saved as a name.command file which can be run from the desktop.
Example,
PC -> MAc
echo = echo
copy = cp
ren = mv
del = rm
if = if (although conditions are different)
help = man
type = cat or more

and so on.
 
OP
L
Joined
Mar 1, 2007
Messages
53
Reaction score
0
Points
6
guys...well
i have this
C: \Progfile\Java\jdk1.6\bin\idlj -fall AddressBook.idl

C: \Progfile\Java\jdk1.6\bin\javac address_book_system/*.java address_book_system/address_bookPackage/*.java


AdressBook.idl is another file that i cant run btw
so can anyone explain me how to change the code?
how can i convert it to run...
 
Joined
Mar 22, 2007
Messages
1,463
Reaction score
67
Points
48
Location
UK
Your Mac's Specs
Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
IDL files are Interface Definiton Files for COM programming and such, so you don't need to convert them.

You need to *rewite* the .bat files - you can't just convert them like a Word document or just rename them because they contain DOS commands which Unix won't recognise. I mentioned TextEdit because DOS batch files and Unix command scripts are plain text files.

Each .bat files needs to have it's commands converted to Unix commands, as per the list pjhutch provided. Depending on what the files do this may not be a trivial task, particularly if the batch files are expecting to run in a DOS/Windows environment.
 
OP
L
Joined
Mar 1, 2007
Messages
53
Reaction score
0
Points
6
yes i know that but is the example i wrote before,there is nothing to convert...its just directories...
 
Joined
Mar 22, 2007
Messages
1,463
Reaction score
67
Points
48
Location
UK
Your Mac's Specs
Lenovo Z560 Hackintosh -:- '06 iMac -:- iPod Touch 2ndGen
For the third time, ;), you can't just convert DOS batch files to UNIX, you have to rewrite them. DOS paths are completely different to UNIX, as is the location of the Java compiler. That second example you gave runs the Java compiler to compile the Address Book Java app. Your best bet is to download a Java IDE like NetBeans and compile the project in there, or leanr how the Java conmpiler works under OSX.
 
OP
L
Joined
Mar 1, 2007
Messages
53
Reaction score
0
Points
6
i know that i have to rewrite thats why i am asking you guys.anyway this files cannont run from netbeans i have to run them manually.anw thanks
 
Joined
Oct 27, 2005
Messages
4,702
Reaction score
404
Points
83
Because you are working with Mac OS, the DOS .bat files won't run when executed, as they are commands written in DOS and designed to run on Windows PCs.

They are basically the same a Shell-Scripts on a Mac and as such contain a string of commands .... you can open and view these commands using a Text Editor but AFAIK, ultimately you will need to write your own Shell-Scripts based on these commands if you want to run them ...

So, the next step to help you is to know what exactly are the type of commands you need to re-write?



#
 
OP
L
Joined
Mar 1, 2007
Messages
53
Reaction score
0
Points
6
C: \Progfile\Java\jdk1.6\bin\idlj -fall AddressBook.idl

C: \Progfile\Java\jdk1.6\bin\javac address_book_system/*.java address_book_system/address_bookPackage/*.javaC: \Progfile\Java\jdk1.6\bin\idlj -fall AddressBook.idl

C: \Progfile\Java\jdk1.6\bin\javac address_book_system/*.java address_book_system/address_bookPackage/*.java
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top