Nov 8, 2009
Pages: 1, 2, 3

Batch Files - Tutorial

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > How-To's and Tutorials > Programming > MISC (not applicable to above Programming Categories)

Batch Files - Tutorial

divinity
Thanks, this helped.

Comment/Reply (w/o sign-up)

iGuest-saif
Opening Multiple Files simultaneously from batch file
Batch Files

I would like to open multiple files from a batch file.My code is

Call file x
Call file y
And so on

But the files open one by one and not until I close the first file the second does not open. Kindly advise

-question by saif

Comment/Reply (w/o sign-up)

(G)ChrisUK
I want to create a batch file the creates a Folder called= Themes & MODS
Batch Files

I am trying to create a batch file to copy loads of files to a specific Folder that will be named

Themes & MODS 

When I run the batch file it does not seem to recognize the Syntax> Themes & MODS and says an error trying to create the file?

The structure I'm using is very simple PLEASE SEE BELOW...

:BEGIN
@ECHO OFF
ECHO. **************************************
ECHO. **    PSPWillys PSP Custom waves 2009             *   
ECHO. ** For XMBeditor v2 Running CFW 3.90m33-2      *   
ECHO. **************************************
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
Md  F:\Themes&Mods\Mods\system_plugin_bg
Md  F:\Themes&Mods\Mods\system_plugin_bg\Allsort
Copy Allsort\Preview.Jpg   F:\Themes&mods\mods\system_plugin_bg\Allsort

This is just a sample of the batch code I'm writing...Is the problem with the "&" syntax?

If it is can someone point me in the right direction

ChrisUK

 

 

 


Comment/Reply (w/o sign-up)

Darasen
The & is telling the command line parser that a new command is beginning. Thus your sytax is not going to work.

The easiest solution would be to rename rhw offending folder to something friendlier to the batch file syntax.

Comment/Reply (w/o sign-up)

(G)Andrew
Creating User Defined Folders using DOS
Batch Files

Hi there,

 

I was wondering if anyone had any code for a user to run a bat file and then have to enter a folder name to be created.

 I have seen several peices of code but nothing really stood out to me, I am a novice in DOS.

Any Help would be fantastic

Thank you

andrew


 


Comment/Reply (w/o sign-up)

(G)iGuests little helper
Opening Multiple Files simultaneously from batch file
Batch Files

This was mentioned earlier, but not explained. If you execute another application from a batch file it will halt since it then waits for input from this application. To just start it and move on use the prefix "start".

-reply by iGuests little helper

 


Comment/Reply (w/o sign-up)

(G)Nick O\
Anser feedbacker
Batch Files

hey,

there are two ways to fix your problem:

1.) Add anouther line to the script  and type "pause" without the air quotes.

2.) Copy the BAT script to C:\WINDOWS\system32 , hit start , hit run , type cmd and hit enter , then enter the name of your BAT (e.G. Something.Bat) then it should run properly but it will still flash away if you don't start it in cmd.

that should help.

-reply by Nick O'Neill

Comment/Reply (w/o sign-up)

(G)Mat
Open 3 command prompts and 2 folder locations in a batch file
Batch Files

Hi,

I want to open 3 command prompts those will be pointing to

cmd1 should point to 'C:\Tomcat'
Cmd2 should point to 'C:\Tomcat\lib'
Cmd3 should point to 'D:\Test'

Also I need to open 2 folder locations(2 different windows simultaneously)
1) C:\Program Files
2) D:\Lab

How can I do these all in a single bat file? I need to open the above listed windows in a single click


Comment/Reply (w/o sign-up)

(G)Abdul
NEED HELP (.vbs or .bat ) getting
Batch Files

Set WTS = Wscript.CreateObject("WTSManager.Shell")
Ip = WTS.MyIPAddress
Msgbox ip

I will get ip from vbs file

 

echo off
Net use v: /delete
Net use v: \\%clientname%.Domain.Com\c$ /User:%clientname%\administrator password@pass

need to change

net use v: \ip\c$ /User:%clientname%\administrator password@pass

if NOT %errorlevel% ==0 goto :err
C:
Cd c:\program files\Stellent\IBPM
IBPM.Exe
Exit

:err
Echo %errorlevel%
Echo Error Occured Logging in to Optika
Pause 

-reply by Abdul

Comment/Reply (w/o sign-up)

(G)

Here are 2 files that I JUST made for you.

The 1st is a program that asks for a folder name to make, and will make it in the directory specified within the batch file.  I highlighted it so you can change the path. Make sure to change them ALL to the SAME EXACT PATH.

 

@echo off
Title .::FOLDER CREATOR by Dan Wager::.
Color A
:top
Cls
Echo Folder name to be created?
Set /p folder=""
If exist C:\"%folder%" goto alreadyExist
Cls
Echo Make folder "%folder%" in C:\?
Set /p choice=""
If "%choice%"=="y" goto execute  ::"y" or ENTER will Execute command
If "%choice%"=="" goto execute
If "%choice%"=="and" goto top      ::"and" will NOT execute command
Goto top
:execute
Md c:\"%folder%"
If exist C:\"%folder%" goto again
Cls
Echo Folder Creation Failed...
Echo Try Again?
Set /p bad=
If "%bad%"=="y" goto top  ::anything other than "y" or ENTER will exit
If "%bad%"=="" goto top
Cls
Echo Press ENTER to Exit
Pause >nul
Exit

:again
Cls
Echo Folder Created Successfully
Echo Make Another Folder?
Set /p another=
If "%another%"=="y" goto top  ::anything other than "y" or ENTER will exit
If "%another%"=="" goto top
Cls
Echo Press ENTER to Exit
Pause >nul
Exit

:alreadyExist
Cls
Echo Folder Already Exists
Echo Press ENTER to Choose a Different Name
Pause >nul
Goto top

_________________________________________________________

The second is a program that asks for both the folder name and path that you want to make.  When entering the path name, do NOT put a back slash at the end of the path (\) or else it wont work.

 

@echo off
Title .::FOLDER CREATOR by Dan Wager::.
Color A
:top
Cls
Echo Folder name to be created?
Set /p folder=""
Cls
Echo Where Do You Want The Folder Created?
Echo example:  C:\Documents and Settings\All Users
Set /p location=""
If exist "%location%"\"%folder%" goto alreadyExist
Cls
Echo Make folder "%folder%" in %location%?
Set /p choice=""
If "%choice%"=="y" goto execute  ::"y" or ENTER will Execute command
If "%choice%"=="" goto execute
If "%choice%"=="and" goto top      ::"and" will NOT execute command
Goto top
:execute
Md "%location%"\"%folder%"
If exist "%location%"\"%folder%" goto again
Cls
Echo Folder Creation Failed...
Echo Try Again?
Set /p bad=
If "%bad%"=="y" goto top  ::anything other than "y" or ENTER will exit
If "%bad%"=="" goto top
Cls
Echo Press ENTER to Exit
Pause >nul
Exit

:again
Cls
Echo Folder Created Successfully
Echo Make Another Folder?
Set /p another=
If "%another%"=="y" goto top  ::anything other than "y" or ENTER will exit
If "%another%"=="" goto top
Cls
Echo Press ENTER to Exit
Pause >nul
Exit

:alreadyExist
Cls
Echo Folder Already Exists
Echo Press ENTER to Choose Again
Pause >nul
Goto top

 

HOPE THIS HELPS!!

 



Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2, 3

See Also,

*SIMILAR VIDEOS*
Searching Video's for batch, files, tutorial
advertisement



Batch Files - Tutorial

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com