Go Back   Microsoft Operating System Forum > Microsoft Operating System > Windows XP

FOR %B IN (*.*) echo "%B" Is there any way to edit the %B variable? I know the basic ones like "%~nB" which will take just the name, or "%~pB"


Microsoft OS Forum to Usenet Gateway is a gateway to Microsoft Windows operating system newsgroups. If you use Windows XP, Windows Vista or any other Microsoft Operating System then this is the community for you.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.

Once you register you'll stop seeing this message.
Log in

Reply
 
Thread Tools Display Modes
Old 01-06-2009, 08:05 PM   #1
NvrBst
Guest
 
Posts: n/a
Edit FOR Variable in CMD.exe

FOR %B IN (*.*) echo "%B"

Is there any way to edit the %B variable? I know the basic ones like
"%~nB" which will take just the name, or "%~pB" which will give the
path only, but say I want to remove the first character?

I know with Environment Variables I can do like the following to
remove just the first character, is there something like this for the
"%B" variable?:
set MYVAR=Hello.txt
echo %MYVAR:~1%


I'm using "cmd.exe" in Windows XP SP3. Thanks
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote


Old 01-07-2009, 12:49 AM   #2
Pegasus \(MVP\)
Guest
 
Posts: n/a
Re: Edit FOR Variable in CMD.exe


"NvrBst" <nvrbst@gmail.com> wrote in message
news:8924f257-1594-4f61-9686-06e1e5cab76b@s1g2000prg.googlegroups.com...
> FOR %B IN (*.*) echo "%B"
>
> Is there any way to edit the %B variable? I know the basic ones like
> "%~nB" which will take just the name, or "%~pB" which will give the
> path only, but say I want to remove the first character?
>
> I know with Environment Variables I can do like the following to
> remove just the first character, is there something like this for the
> "%B" variable?:
> set MYVAR=Hello.txt
> echo %MYVAR:~1%
>
>
> I'm using "cmd.exe" in Windows XP SP3. Thanks


You have to assign its current value to an env. variable before removing the
first character:
set MyVar=%b
echo %MyVar:~1%


 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
cmdexe, edit, variable



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use a variable to call a variable preiously set. Richhall Windows XP 8 09-19-2008 09:34 AM
variable system luc bonenfant Windows 2003 Server 7 06-05-2008 01:26 PM
whats in a variable Hassan Windows 2003 Server 1 12-18-2007 01:07 AM
Adding commands to "Folder Options/Edit File Type/Actions" grayed-out "Edit" & "Remove" Green_XP Windows XP 1 11-06-2007 02:48 AM
changes to path variable bbxrider Windows XP 4 09-18-2007 10:36 PM




This is a Schwarz Network site.

All times are GMT -5. The time now is 08:45 PM.
Designed by: vBSkinworks