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 17 November 2005, 01:25 PM
  #1  
David_Wallis
Scooby Regular
Thread Starter
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
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
Old 17 November 2005, 03:25 PM
  #2  
smokebelch
Scooby Regular
 
smokebelch's Avatar
 
Join Date: Mar 2005
Posts: 101
Likes: 0
Received 0 Likes on 0 Posts
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 ....
Old 17 November 2005, 04:41 PM
  #3  
David_Wallis
Scooby Regular
Thread Starter
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Default

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



Quick Reply: Batch File Q



All times are GMT +1. The time now is 05:38 AM.