Computing.Net > Forums > Programming > Problem creating batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Problem creating batch file

Reply to Message Icon

Name: jargon
Date: August 31, 2008 at 12:14:36 Pacific
OS: windows XP Sp2
CPU/Ram: P4 1.5GHZ / 1Gb
Product: Intel
Comment:

Hi,
I want to create a batch file using NTService.exe. My problem is like when i am passing the path like -start c:\program files\.... then it is not taking the space between "program" and "files". I want to escape this blank space. Could you tell me what is the syntax for that.
Thanks.

Jargon



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: August 31, 2008 at 13:05:37 Pacific
Reply:

Your post sounds me quite confused, but to manage a path with embedded blanks you have to embrace that between double quotes, i.e.

"C:\program files\...."

Pay attention however that if you want to pass such a path to a Start command you must code the statement as below

Start "" "C:\program files\...."

hotherwise nothing works.


0

Response Number 2
Name: Trent M
Date: August 31, 2008 at 13:09:58 Pacific
Reply:

Batch files go by the old DOS way of naming files and directories. If the name of a file or directory in windows is more than 8 letters long, DOS calls it by the first 6 letters followed by ~1.

For example, spectacular.txt would be called specta~1.txt in DOS. If there are 2 files, one called spectacular.txt and one called spectaculars.txt, spectacular.txt would be called specta~1.txt and spectaculars.txt would be called specta~2.txt.

So the directory Program Files is called progra~1 in a batch file.

Hope this helps,

-Trent

Compaq Presario 5365
AMD K6-2 450 Mhz
256 MB RAM
Dual-booting Windows 98 SE and SimplyMepis 3.4

RedHat 9 worked fine without problems.


0

Response Number 3
Name: IVO
Date: August 31, 2008 at 14:10:43 Pacific
Reply:

Sorry, but batch scripts under NT kernel systems (NT/2K/XP)can manage LFN paths and names without problems as the interpreter is cmd.exe NOT command.com.

What you say applies to legacy programs only, those developed as 16 bits applications and managed by NTVDM subsystem.

So no need of short format translation usually.


0

Response Number 4
Name: Trent M
Date: August 31, 2008 at 14:39:34 Pacific
Reply:

OK, sorry.

Compaq Presario 5365
AMD K6-2 450 Mhz
256 MB RAM
Dual-booting Windows 98 SE and SimplyMepis 3.4

RedHat 9 worked fine without problems.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


batch to extract string b... Dos Batch File Backup



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Problem creating batch file

create batch file www.computing.net/answers/programming/create-batch-file/16262.html

path problem in batch file... www.computing.net/answers/programming/path-problem-in-batch-file/9916.html

Help creating batch file... www.computing.net/answers/programming/help-creating-batch-file/15530.html