Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

How to execute a .cfg file

Original Message
Name: Stefan Perdal
Date: November 21, 2003 at 01:01:42 Pacific
Subject: How to execute a .cfg file
OS: Windows NT 4.0
CPU/Ram: P3@1Ghz/128 Mb
Comment:
How do I execute a file that doesn't have the file extension .bat? I want to execute a .cfg that contains a lot of set variables.

Report Offensive Message For Removal


Response Number 1
Name: IVO
Date: November 21, 2003 at 02:10:40 Pacific
Subject: How to execute a .cfg file
Reply: (edit)
Just copy it renaming the destination file with the .bat extension and then run it. I assume, as you posted, the .cfg file contains executable batch commands and comment lines.

Report Offensive Follow Up For Removal

Response Number 2
Name: Stefan Perdal
Date: November 21, 2003 at 03:23:59 Pacific
Subject: How to execute a .cfg file
Reply: (edit)
It's like this. I have a main blabla.bat file with the script itself. I want that script to read all the variables from the blabla.cfg So other people easy just can change the config file. And also wan other scripts to read from the same config file aswell.


Report Offensive Follow Up For Removal

Response Number 3
Name: IVO
Date: November 21, 2003 at 04:52:07 Pacific
Subject: How to execute a .cfg file
Reply: (edit)
To help you, a more accurate description of the content of the config file is needed, as the way the main batch has to exploit to access the related configuration script is bound to the .cfg structure.

Report Offensive Follow Up For Removal

Response Number 4
Name: Stefan Perdal
Date: November 21, 2003 at 07:51:12 Pacific
Subject: How to execute a .cfg file
Reply: (edit)
Some examples...
main.bat
copy %1% %outdir%%1%

And the configfile..
main.cfg
set outdir=c:\batman\



Report Offensive Follow Up For Removal

Response Number 5
Name: IVO
Date: November 21, 2003 at 12:49:16 Pacific
Subject: How to execute a .cfg file
Reply: (edit)
According to your post, the best way to accomplsh what you want under Windows NT/2K/XP is to use the following statement

For /F "tokens=*" %%A in (Main.cfg) Do %%A

That assumes Main.cfg contains executable statements only (as your Set...)

Otherwise if you want to mantain compatibility with the DOS-kernel Windows 9X/ME, you have to turn to the less cool

Copy Main.cfg MainCfg.bat
Call MainCfg
Del MainCfg.bat



Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: How to execute a .cfg file

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




acer 312T BIOS problem

K7 Turbo possible max fsb?

Pc anywher problem

WinFLP & OE/Outlook2003

Computer resets after a few minutes


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC