Computing.Net > Forums > Programming > Help With Batch Programming

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.

Help With Batch Programming

Reply to Message Icon

Name: frank664
Date: February 24, 2004 at 09:42:38 Pacific
OS: Windows 98
CPU/Ram: NA
Comment:

What I am trying to do is I have a variable that is in the format of FS/SYS\Homedir\username and I need it to be in the format of F:\Homedir\username. Is there a way to do this with batch programming?

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: February 24, 2004 at 14:07:10 Pacific
Reply:

Just via the following single statement

Set MyVar=%MyVar:FS/SYS=F:%

assuming MyVar is the name of variable to be rearranged.



0

Response Number 2
Name: IVO
Date: February 24, 2004 at 14:12:07 Pacific
Reply:

Sorry! I missed to look at your operating system; my solution works under Win NT/2K/XP only while Windows 98 is a DOS-kernel environment. To achieve the job here using a batch script is a tricky job.


0

Response Number 3
Name: dtech10
Date: February 26, 2004 at 03:05:43 Pacific
Reply:

Hi frank664

The only way I've figured to perform your
task is with a third party program called
Change.com which lets you change text within
a text file.
It came from an old PC Magazine floppy I have
and works in XP ok.
It you can't find it on the net, let me know and I'll email you a copy.

--------------
@echo off
if not "%1"=="" goto makepath
rem Line below for Testing Only
set xx=FS/SYS\Homedir\username
echo test.bat %xx% > tmp.bat
rem change "/" to a space
rem so can be treated as parameters.
change tmp.bat "\" " " > nul
call tmp.bat
goto end
:makepath
set xxx=c:\%2\%3
echo %xxx%
:end
---------------


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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: Help With Batch Programming

Help with making C++ Program www.computing.net/answers/programming/help-with-making-c-program/4217.html

Batch File Creation with MD www.computing.net/answers/programming/batch-file-creation-with-md/11547.html

Need help with C++ program www.computing.net/answers/programming/need-help-with-c-program/5152.html