Computing.Net > Forums > Programming > DOS - Replace Environment variable

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.

DOS - Replace Environment variable

Reply to Message Icon

Name: trusp
Date: January 27, 2009 at 23:05:53 Pacific
OS: DOS
CPU/Ram: Intel DUO
Product: Ms / Ms/e6550
Subcategory: Batch
Comment:

Hi

I created the DOS based batch file as below:

set STR_PATH=%1
........
........

I am passing the argument as C:\TestDir\Test

So here in a period of time I need the STR_PATH value to be replaced as C:/TestDir/Test.
Is there any way to replace '\' with '/' in DOS.

So present value is : STR_PATH=C:\TestDir\Test
Required value is : STR_PATH=C:/TestDir/Test

Please help me out in this issue asap.

Trusp



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: January 28, 2009 at 00:03:56 Pacific
Reply:

DOS? No.

Command Prompt? Yes.


0

Response Number 2
Name: trusp
Date: January 28, 2009 at 02:09:07 Pacific
Reply:

yes .. Batch File


0

Response Number 3
Name: IVO
Date: January 28, 2009 at 02:21:04 Pacific
Reply:

set STR_PATH=%STR_PATH:\=/%


0

Response Number 4
Name: trusp
Date: January 28, 2009 at 02:58:10 Pacific
Reply:

Thanks IVO. Its working fine.


0

Response Number 5
Name: Mechanix2Go
Date: January 28, 2009 at 08:41:43 Pacific
Reply:

In DOS

set STR_PATH=C:/TestDir/Test


=====================================
If at first you don't succeed, you're about average.

M2


0

Related Posts

See More



Response Number 6
Name: trusp
Date: January 28, 2009 at 20:55:30 Pacific
Reply:

Yes Mechanix2Go

I need that environment variable to be set like that.
Thanks


0

Sponsored Link
Ads by Google
Reply to Message Icon






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: DOS - Replace Environment variable

windows environment variables www.computing.net/answers/programming/windows-environment-variables/1098.html

VB.NET and Environment Variables www.computing.net/answers/programming/vbnet-and-environment-variables/9708.html

Environment variable in C www.computing.net/answers/programming/environment-variable-in-c/13426.html