Search found 126 matches
- 10 Aug 2011 11:41
- Forum: DOS Batch Forum
- Topic: Batch File performance - For Vs. Call
- Replies: 6
- Views: 5549
Re: Batch File performance - For Vs. Call
I was wrong, you were right. Instead of switching back and forth and timing, I wrote another script to undo the copy and ran it back to back to back 10 times and the time really was fluctuating by as much as 60+ seconds. I switched it and ran it again, and saw that it still fluctuated by 60+ seconds...
- 10 Aug 2011 11:05
- Forum: DOS Batch Forum
- Topic: Batch+ Project
- Replies: 61
- Views: 45143
Re: Batch+ Project
I am Rang, and I've done what you're doing... A loooong, loooong, looooooooooooong time ago. Then I got smarter, downloaded the source for ROM and modified that so I could have multiplayer And back on topic... @Orange - If I ever finish PowerBat, I'll give you a copy. I'm using the win-API and no .N...
- 10 Aug 2011 10:04
- Forum: DOS Batch Forum
- Topic: Batch File performance - For Vs. Call
- Replies: 6
- Views: 5549
Re: Batch File performance - For Vs. Call
I thought about that too, and while I only ran it 6 times both ways, the 1st way is consistently 30-50 seconds for 1700 test files and the 2nd version is consistently 90-120 seconds for the same files. It's wierd. I will change my IN() though just to be more efficient. And I still like the look of t...
- 09 Aug 2011 16:35
- Forum: DOS Batch Forum
- Topic: What does it means: SET %~1=!%1:b=B!
- Replies: 3
- Views: 3967
Re: What does it means: SET %~1=!%1:b=B!
@Ed, I think part of the problem is that his Example is wrong. It's not SET %PATH:str1=str2%... It should be SET PATH=%PATH:str1=Str2% and then it not only works, but it also mimics his example question: SET PATH=%PATH:str1=Str2% SET %~1=!%1:str1=str2! Now the only difference is the ! being used for...
- 09 Aug 2011 07:31
- Forum: DOS Batch Forum
- Topic: Batch File performance - For Vs. Call
- Replies: 6
- Views: 5549
Batch File performance - For Vs. Call
So while I'm waiting on feedback for my latest script I decided to go clean up some of my older scripts I still use today, starting with my file-indexing script. I ran into something strange (Strange being relative to my own knowledge and what I've learned on this site recently). I changed this code...
- 08 Aug 2011 08:00
- Forum: DOS Batch Forum
- Topic: IF Statement Syntax
- Replies: 24
- Views: 16052
Re: IF Statement Syntax
@Dave, Removing the IF block - The length of the number in %%C is never over 4, so your solution worked for shaving off some time, cutting that loop from 50-62 seconds down to 21-30 seconds. CSVFix does have a pad command, but it's used to pad the number of fields and not the values in them, so if y...
- 05 Aug 2011 15:39
- Forum: DOS Batch Forum
- Topic: IF Statement Syntax
- Replies: 24
- Views: 16052
Re: IF Statement Syntax
Ed, here are two sections I'm fairly certain I can get compressed into one, but after looking at the map-value (I've been there!) I'm not sure putting 10 thousand calls is going to resolve the problem... First this section takes comma delimited output, %CMD% can be typed output from a CSV file or in...
- 05 Aug 2011 14:48
- Forum: DOS Batch Forum
- Topic: IF Statement Syntax
- Replies: 24
- Views: 16052
Re: IF Statement Syntax
Well, it's not ALL native DOS. I am using CSVFix for most of the file manipulation, comparisons, etc... I'm using DOS for things that CSVFix won't do yet. Like filling subsequent rows with data from previous rows, but only on certain conditions etc... I could do the whole thing in DOS, but that woul...
- 05 Aug 2011 13:48
- Forum: DOS Batch Forum
- Topic: IF Statement Syntax
- Replies: 24
- Views: 16052
Re: IF Statement Syntax
Yeah but what I am looking at for speed here is flow. I have some large files I'm looping through, and while CSVFix is fast, it doesn't do everything I need it to yet. Still working on that. So I end up looping through a few files several times to accomplish the end result and since it's the loop th...
- 03 Aug 2011 09:46
- Forum: DOS Batch Forum
- Topic: IF Statement Syntax
- Replies: 24
- Views: 16052
Re: IF Statement Syntax
Well, since I was already having to use a FOR loop to check (which is ok, it's fast enough) I went with: SET Check=%%C SET "test=/BH/TD/RB/RC/AB/" <--- Just moved this outside of the loop. FOR /f "delims=" %%a IN ("/!Check~1,2!/") DO (IF "!test:%%a=!" neq &quo...
- 03 Aug 2011 08:47
- Forum: DOS Batch Forum
- Topic: Batch file to run cmds only if user is NOT an administrator
- Replies: 5
- Views: 5429
Re: Batch file to run cmds only if user is NOT an administr
You're welcome SpyGob, but Ed's way is more "accurate" incase you do have users that have administrative rights. This usually occurs in the home/ home office where the first username registered on the PC has administrative rights and in businesses where the "administrator" accoun...
- 03 Aug 2011 07:54
- Forum: DOS Batch Forum
- Topic: IF Statement Syntax
- Replies: 24
- Views: 16052
Re: IF Statement Syntax
Ahah! (Maybe)... Check is actually set as the first 2 characters of %%~C in a FOR loop... But only the first 2 characters. Right after my Ahah! moment though I realized that I had already tried to do something like: SET Check=%%C:~1,2% And was told I had to put it in two set statements to do it... (...
- 02 Aug 2011 17:26
- Forum: DOS Batch Forum
- Topic: IF Statement Syntax
- Replies: 24
- Views: 16052
Re: IF Statement Syntax
Thanks again Dave! I'll have to play around with that tomorrow... I was thinking about the test string you created, it won't change and can be set outside of a command block. I'm going to fool around with that tomorrow and see if I can get this to work instead: if "%test:/!Check!/=%" neq &...
- 02 Aug 2011 15:51
- Forum: DOS Batch Forum
- Topic: IF Statement Syntax
- Replies: 24
- Views: 16052
Re: IF Statement Syntax
Dang This is great, but it doesn't work if you also have to expand !Check!... set "test=/BH/TD/RB/RC/AB/" if "!test:/!Check!/=!" neq "!test!" ( <Some Commands if found a match> ) else ( <Other Commands> ) !Check! doesn't expand and so nothing gets replaced with nothing....
- 02 Aug 2011 08:53
- Forum: DOS Batch Forum
- Topic: Batch file to run cmds only if user is NOT an administrator
- Replies: 5
- Views: 5429
Re: Batch file to run cmds only if user is NOT an administr
Ed you know... You're right I didn't think about that...