Can Unix (Solaris) execute a dos .bat script?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can Unix (Solaris) execute a dos .bat script?
# 1  
Old 08-25-2006
Can Unix (Solaris) execute a dos .bat script?

I did a search and found lots of questions/comments about how a dos script could execute Unix but not the other way round. If it's possible, I'd like the link to a post/site that would show me the way.

Thanks.
# 2  
Old 08-25-2006
simply put, no it cannot.
# 3  
Old 08-25-2006
I didn't think so, but....

was praying that maybe someone got creative and found a way. Thanks for the reply. Smilie
# 4  
Old 08-25-2006
Depending on what your .bat is trying to do, you MAY be able to replicate the functionality by converting the batch commands to shell commands and creating yourself a shell script to run them. But there isn't any way to just run a .bat on its own.
# 5  
Old 08-26-2006
The real issue is what commands are being run in a batch file. A batch file is the same, functionally as a ksh, sh, or csh script file. It's just a text file with a list of commands to be sequentially run. If the commands in the batch file exist on a unix box (solaris), then the batch file should run.

Linux, for example, has several aliases the make it seem a little like dos. Dir for example. On my windows boxes, I have unix commands that are actually scripts. ls, clear, etc.

Environment variables are created differently (dos uses semicolons, unix uses colons) so you'd have to build in similarities. You might be able to create a cross platform script if you're a little creative but things wont be as clean. You won't be able to start the script with the @Echo off for example. You could start it with #!/bin/ksh since dos would ignore it as a comment. Anything fancy like loops wouldn't work just because of the difference in how they work.

Carl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script to convert dos to UNIX in Solaris

Hi Team, I am trying to implement a script in Solaris, that required to find the list of files inside directories and convert those to dos2unix conversion, Can someone please help here.. Below is the example of scenario.... (1 Reply)
Discussion started by: Logics123
1 Replies

2. Windows & DOS: Issues & Discussions

DOS bat file to add to path

This may not be the right place, since it is not exactly unix or linux, but it does involve cygwin. I have two cygwin installations. When I start a mintty terminal, I need to toggle a windows path variable to make sure that the correct cygwin dll gets loaded. I need to add C:\cygwin\bin to the... (3 Replies)
Discussion started by: LMHmedchem
3 Replies

3. Solaris

Need to execute the script with script name wihtout using ./scriptname in Solaris 10

Hi, I am using solaris 10.Is there any way to execute the script with the scriptname wihtoug using ./scriptname?Also does it varies from shell to shell.I have scripts in bash,ksh,sh shells. Example:script.sh is the script name.I need to execute the script like this script.sh instead... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

4. Solaris

write a script to execute some operations on sun solaris

Sun Microsystems Inc. SunOS 5.9 Generic May 2002 SUNFIRE V240 if there is a power failure, automatically: write all operations in a log file (0 Replies)
Discussion started by: doudou2012
0 Replies

5. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

6. Windows & DOS: Issues & Discussions

Windows remote to Solaris to execute ksh script

Hi all, I'm not sure if it is correct to post here. I am facing problem wanting to create a batch that run from my Windows XP pc to remote to multiple Solaris server to execute the server's ksh script. :wall: Can anyone give me a hints on how to do that? Thanks. (6 Replies)
Discussion started by: beginningDBA
6 Replies

7. Shell Programming and Scripting

Building a DOS .bat file that will root my Droid 2 phone using adb

1. What I am doing? Building a DOS .bat file that will root my Droid 2 phone using adb commands in the .bat file. (Just for the fun of it and to help me learn "stuff".) 2. Problem: Here are the problem steps to accomplish this task manually in an adb shell: adb shell (Prompt is $) cd... (2 Replies)
Discussion started by: chrstdvd
2 Replies

8. Solaris

how to Implicitly execute some unix commands during/after Solaris reboot

I have to execute 2 commands everytime i reboot my Solaris machine. Simple "share" and "chown" commands. Is there anywhere (maybe a config file or something) where I can include these commands so that I do not have to manually run them everytime I reboot the machine? Any help appreciated... (2 Replies)
Discussion started by: lydiaEd
2 Replies

9. Shell Programming and Scripting

execute shell file on DOS prompt

I have installed cygwin on my computer having windows 2003 server as operating system. The following command works fine on DOS console: bash launch_update.sh Is there any way, that i could run the above shell file, just by typing its name on DOS prompt, in the same way as batch files are... (1 Reply)
Discussion started by: mmunir
1 Replies

10. Shell Programming and Scripting

Execute a UNIX script from DOS prompt.

Hello, I m trying to execute a UNIX task from windows, I am copying few csv files from UNIX platform to my windows using a bat file like the txt file is as follows : open 172.21.13.239 root root lcd C:\Documents and Settings\aparna_sharma\Desktop\Trunk_Analysis cd /opt/Trunk_Analysis/... (24 Replies)
Discussion started by: er_aparna
24 Replies
Login or Register to Ask a Question