SoftwareTipsandTricks Forum

Go Back   SoftwareTipsandTricks Forum > Operating Systems > Windows NT/2000/2003
User Name
Password


Batch file commands

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes

  #1  
Old 05-18-2005, 10:21 AM
JP-D Offline
Registered User
 
Join Date: Apr 2005
Posts: 6
Batch file commands

I cannot track down a decent list of file commands (DEL for delete etc) on the Internet. Does anyone have a link that they would recommend?
Reply With Quote

  #2  
Old 05-19-2005, 01:22 PM
snowmonkey's Avatar
snowmonkey Offline
Registered User
 
Join Date: Jun 2003
Location: Canada
Posts: 3,355
Send a message via MSN to snowmonkey
Here is a bunch:

http://kb.iu.edu/data/aerh.html?cust=917015.41069.30

Cheers
Reply With Quote

  #3  
Old 05-20-2005, 01:27 AM
Cache's Avatar
Cache Offline
ST&T Secret Police
 
Join Date: Jun 2004
Location: UK
Posts: 616
http://www.google.co.uk/search?hl=en... mmands&meta=

The best commands to learn are @ ECHO OFF, ECHO., SET, SET /P, IF, GOTO, EQU, * and %, that what I think anyway.
Here is one I made for XP that used SET and IF. Its pointless really but fun to make. It should give you some idea of how the commands can be used:

TITLE Directory Master
COLOR 1F
@ ECHO OFF

:start
CLS
ECHO Please choose from the folowing options...
ECHO.
ECHO 1: Make folder
ECHO 2: Delete file
ECHO 3: Delete folder
ECHO 4: Rename folder or file
ECHO 5: Move folder or file
ECHO 6: Exit program
ECHO.

SET /P CHOICE=

IF %CHOICE% EQU 1 GOTO A
IF %CHOICE% EQU 2 GOTO B
IF %CHOICE% EQU 3 GOTO C
IF %CHOICE% EQU 4 GOTO D
IF %CHOICE% EQU 5 GOTO E
IF %CHOICE% EQU 6 (EXIT)

ECHO.
ECHO Error "%CHOICE%" is not an option. Please try again...
PAUSE
GOTO start

:A
ECHO.
ECHO Please enter the path and name to use for the new folder...
SET /P NEWDIR=
MKDIR %NEWDIR%
ECHO.
ECHO New folder was created at %NEWDIR%
ECHO If no path was given "%NEWDIR%" will have been created in the working directory
pause
GOTO start

:B
ECHO.
ECHO Please enter the full path to the file you would like to delete
ECHO "Wrap the path in quotation marks"
SET /P DELFILE=
IF EXIST %DELFILE% (DEL %DELFILE%) ELSE ECHO Error no file found at "%DELFILE%"
PAUSE
GOTO start


:C
ECHO.
ECHO Please enter the full path to the folder you would like to delete
ECHO "Wrap the path in quotation marks"
SET /P DELDIR=
IF EXIST %DELDIR% (RD %DELDIR%) ELSE ECHO Error no folder found at "%DELDIR%"
PAUSE
GOTO start


ECHO.
ECHO Please enter the full path to the folder you would like to rename
ECHO "Wrap the path in quotation marks"
SET /P RENDIR=
ECHO.
ECHO Please enter the new name...
SET /P RENAME=
IF EXIST %RENDIR% (REN %RENDIR% %RENAME%) ELSE ECHO Error no file or folder found at "%RENDIR%"
PAUSE
GOTO start

:E
ECHO.
ECHO Please enter the location of the folder or file to move
ECHO "Wrap the path in quotation marks"
SET /P MOVDIR=
ECHO.
ECHO Please enter the location you would like to move the foler or file to
ECHO "Wrap the path in quotation marks"
SET /P MOVED=
IF EXIST %MOVDIR% (MOVE %MOVDIR% %MOVED%) ELSE ECHO Error no folder or file exists at "%MOVDIR%"
PAUSE
GOTO start

Last edited by cache : 05-20-2005 at 01:35 AM.
Reply With Quote

  #4  
Old 05-23-2005, 07:20 AM
JP-D Offline
Registered User
 
Join Date: Apr 2005
Posts: 6
Thanks a lot snowmonkey and cache.

Cheers

JP-D
Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can not burn a DVD for the life of me seal2be Software Problems and Useful Utilities 13 03-12-2008 05:35 AM
rewriter not working! skoundrel Windows XP 6 05-29-2005 02:31 PM
Deleting a file using a batch file in Windows scheduler JP-D Windows NT/2000/2003 2 05-01-2005 03:07 PM
XP repair installation zenyanz Windows XP 6 05-14-2003 02:20 PM
ClearType Batch File Shario Windows XP 2 02-18-2003 03:45 PM



All times are GMT -5. The time now is 12:49 AM.


Designed by eXtremepixels. Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.3.2 © 2005, Crawlability, Inc.