What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Little help with batch programming

Little help with batch programming
Author: Message:
Chancer
Senior Member
****

Avatar

Posts: 648
Reputation: 7
35 / Male / Flag
Joined: May 2005
Status: Away
O.P. Little help with batch programming
This is my code:
code:
@echo off
FOR /f "tokens=*" %%G IN ('dir /b') DO (
    [my actions, no problem here]
)

It does my actions for each file in the bat file's folder.
The problem is, one of the arguments I need is the file's name without the extension. For example:
%%G is "My text file.txt" and I need to use the command -set name="My text file" .
So I changed -set name="%%G" to -set name="%%G:~0,-4%", which should ignore the last 4 characters (dot + extension), but it doesn't work.

Does anyone know how to solve this?
02-03-2010 06:46 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Little help with batch programming - by Chancer on 02-03-2010 at 06:46 PM
RE: Little help with batch programming - by prashker on 02-03-2010 at 09:32 PM
RE: Little help with batch programming - by Lou on 02-03-2010 at 09:33 PM
RE: Little help with batch programming - by prashker on 02-03-2010 at 09:36 PM
RE: Little help with batch programming - by Chancer on 02-04-2010 at 12:05 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On