Welcome Guest ( Log In | Register )



3 Pages V  < 1 2 3 >  
Reply to this topicStart new topic
> Batch Files, Tutorial
warbird
post Jul 1 2005, 09:12 AM
Post #11


Little MechBirdie
Group Icon

Group: Members
Posts: 299
Joined: 23-March 05
From: Down here in Holland
Member No.: 3,178



Very nice tutorial, I tried it and I've a lot of use from it. I now use it for some routines that always annoyed me to do manually. Anyway just very nice. wink.gif
-=jeroen=-
Go to the top of the page
 
+Quote Post
xboxrulz
post Jul 16 2006, 05:37 PM
Post #12


Colonel Panic
Group Icon

Group: [MODERATOR]
Posts: 2,730
Joined: 25-March 05
From: Toronto, Ontario, Canada
Member No.: 3,233



nice tutorial, I really needed it for launching Java applications on Windows (tongue.gif). However, I prefer the BASH Shell Scripts.

For example, I can do system service startup and shutdowns with shell scripts without typing the long command lines over and over again.

CODE

echo "Please enter the root password to restart the network"
su -c "/etc/init.d/network restart"
echo "Done!"


*This code only works on SuSE Linux.

xboxrulz
Go to the top of the page
 
+Quote Post
souradipm
post Jul 20 2006, 03:49 PM
Post #13


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 42
Joined: 17-July 06
Member No.: 14,552



Wow! Another programming language! biggrin.gif Really, batch files could act as a DOS programming language. Good simple tutorial as well. I might write my own batch file. I think I know how it works now. But what does the command 'rem' do?

~souradipm
Go to the top of the page
 
+Quote Post
HellFire121
post Jul 23 2006, 02:47 AM
Post #14


Premium Member
Group Icon

Group: [HOSTED]
Posts: 438
Joined: 28-January 06
Member No.: 10,925



I remember making a batch file to start a service and a few programs when windows started because one program would only run when the other was started and it made it easier, it's also a great way to learn windows shell commands and practise windows scripting.
In my experiences the dos prompt will actually hold more power than the simple explorer.exe which makes it a very handy tool if you know how to use it

-HellFire
Go to the top of the page
 
+Quote Post
masterio
post Nov 30 2006, 01:45 PM
Post #15


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 21
Joined: 24-September 06
Member No.: 16,119



I like batch since it can save my time for start/shutdown my server like Apache, MySQL and hMailServer. I use this batch because I have limited RAM so if all of these service run when Windows start-up it can slow down the start-up time.

Here's the batch that I've user, I name it myserver.bat

CODE
@echo off

set me=myserver.bat - (c) copyright 2006 - Rio Astamal

if "%1"=="start" goto start
if "%1"=="stop" goto stop
if "%1"=="" goto usage

:start
echo Starting server application server...
net start apache2
net start mysql
net start hmailserver
goto quit

:stop
echo sutting down server application...

net stop apache2
net stop hmailserver
net stop mysql
goto quit

:usage
echo usage:
echo   myserver start/stop
echo -------------------------
echo note: start to activate the server and stop to shutdown the server.
echo .
echo .
echo %me%
goto quit

:quit
if "%2"=="yes" (
  exit
)


myserver.bat have 2 argument, the first one is for start/stop the server and the second argument (optional) wheter user want to quit the command prompt or not.

This post has been edited by masterio: Nov 30 2006, 01:46 PM
Go to the top of the page
 
+Quote Post
Quatrux
post Nov 30 2006, 08:14 PM
Post #16


the Q
Group Icon

Group: [HOSTED]
Posts: 1,022
Joined: 13-July 05
From: Lithuania, Vilnius
Member No.: 7,059



I wouldn't call batch files a programming language, but just command files working in console.. why not a programming language? because of mathematics it is able to do, it only recognizes simple numbers like 1,2,3,4.. [-9999999999;+999999999]; And the tools which can compile your bat file to exe is quite ridiculous, usually the compiled version takes 10 times more space than source biggrin.gif but thats kind of quite normal.

Say REXX is a more advanced command file scripting, which is capable of much more.. so I could call it (REXX) a scripting language..

This post has been edited by Quatrux: Nov 30 2006, 08:27 PM
Go to the top of the page
 
+Quote Post
toby
post Dec 2 2006, 10:13 AM
Post #17


Premium Member
Group Icon

Group: Members
Posts: 488
Joined: 29-September 06
Member No.: 16,228



I love this, I often need to end about 5 processes, delete one or two folders, and start three programs.

1. In one folder I want to delete, one of the files is now obsolete, but Windows still loves it. Can I avoid it or delete it through batch files?

2. How do I end a process in these?
Go to the top of the page
 
+Quote Post
Kardus
post Dec 2 2006, 07:18 PM
Post #18


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 41
Joined: 16-November 06
From: Toronto, Ontario
Member No.: 17,325



Batch files were great. I remember when I was younger I used to try and teach myself how they worked by editing them/making my own. Typically they are now used for installers, etc. Most virus scanners DO however pick up non-system batch files, as they can be programmed for malicious purposes.

I remember my friend didn't want his younger brother on his computer, so he made a batch file that shut down the computer when executed. Lets just say he put it in his brother's startup folder and his brother was pretty pissed.

They can, however, be used to complete simple everyday tasks without extensive programming knowledge.

This post has been edited by Kardus: Dec 2 2006, 07:19 PM
Go to the top of the page
 
+Quote Post
.WonderGuy6
post Mar 19 2007, 06:23 AM
Post #19


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 1
Joined: 19-March 07
Member No.: 20,948



Ha good one smile.gif
Go to the top of the page
 
+Quote Post
iGuest
post Feb 15 2008, 12:00 AM
Post #20


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



Problem
Batch Files

Trying to add this into a batch file I am working on, but it is not really working for me, it just closes out the second it comes in..Any help?

@echo off
Echo test
Pause >nul
Echo

===============================================================================
Echo � �============================================�
� � /\ /\ �
Echo � � | | | | �
� � | | | | �
Echo � � | | | | �
� � | | | | �
Echo � � / \ �
� � | O O | �
Echo � � | | �
� � | <__> | �
Echo � � | | �
� � \_______/________________ �
Echo � � | \ �
� � \ \ �
Echo � � \________ \ �
� � / | �
Echo � � / ________|******* �
� � ___ __/ / |******** �
Echo � � | / |********* �
� � | / |******** �
Echo � � |______________/___________|******* �
�
Echo � �=========================================�


============================================================================�

Pause >nul



-Scott
Go to the top of the page
 
+Quote Post

3 Pages V  < 1 2 3 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics


 



- Lo-Fi Version Time is now: 6th September 2008 - 05:52 PM