Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Batch File Q

Thread Tools
 
Search this Thread
 
Old Nov 17, 2005 | 01:25 PM
  #1  
David_Wallis's Avatar
David_Wallis
Thread Starter
Scooby Regular
 
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Default Batch File Q

Im being thick today (hungover)

in a batch file I have done something similar to:

FOR /F "tokens=2-4 delims=/ " %%i in ('DATE /T') do set fdate=%%k_%%j_%%

How the **** can I get the short year using the for command??

I just need 05 or 06 returned.. cant really use another scripting language either

David
Reply
Old Nov 17, 2005 | 03:25 PM
  #2  
smokebelch's Avatar
smokebelch
Scooby Regular
 
Joined: Mar 2005
Posts: 101
Likes: 0
Default

Originally Posted by David_Wallis
Im being thick today (hungover)

in a batch file I have done something similar to:

FOR /F "tokens=2-4 delims=/ " %%i in ('DATE /T') do set fdate=%%k_%%j_%%

How the **** can I get the short year using the for command??

I just need 05 or 06 returned.. cant really use another scripting language either

David
you could put some "if" statements afterwards to set some new variables .. like ...
FOR /F "tokens=2-4 delims=/ " %%i in ('DATE /T') do set fdate=%%j
if %fdate% == 2005 set gdate=05
if %fdate% == 2004 set hdate=04
if %fdate% == 2003 set idate=03

etc ....
Reply
Old Nov 17, 2005 | 04:41 PM
  #3  
David_Wallis's Avatar
David_Wallis
Thread Starter
Scooby Regular
 
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Default

good point.. i managed to do it in the end.. used 20 as the delimiter.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
yabbadoo4
ScoobyNet General
11
Sep 30, 2015 10:33 PM
Nick_Cat
Computer & Technology Related
2
Sep 26, 2015 08:00 AM
Littleted
Computer & Technology Related
0
Sep 25, 2015 08:44 AM
ALi-B
Computer & Technology Related
0
Sep 14, 2015 07:49 AM
riiidaa
ScoobyNet General
1
Sep 12, 2015 11:52 AM




All times are GMT +1. The time now is 08:13 AM.