Search found 31 matches

by kwsiebert
17 Jul 2019 09:17
Forum: DOS Batch Forum
Topic: Strange Issue with FOR LOOP; ignoring last record?
Replies: 3
Views: 2496

Re: Strange Issue with FOR LOOP; ignoring last record?

I didn't try running it, but it looks like it's only testing and outputting the value from the previous loop. LAST is getting set to C-12528180 only at the very end, and then the loop is done, there are no more tests to check if it should be output. You need one more instance of your output statemen...
by kwsiebert
12 Jul 2019 08:54
Forum: DOS Batch Forum
Topic: Calling a bat file with a parameter
Replies: 3
Views: 2546

Re: Calling a bat file with a parameter

That batch file doesn't appear to be making use of using any command line parameters. If I'm reading this right, you seem to be expecting the command line parameter to get piped into the set /p, but that's not how it works.
by kwsiebert
01 May 2019 16:51
Forum: DOS Batch Forum
Topic: Get Parent Directory as a variable
Replies: 6
Views: 2022

Re: Get Parent Directory as a variable

Is the code you posted part of a larger block enclosed in parentheses? If so, you need to use delayed expansion and use !a! instead of %a%.
by kwsiebert
01 May 2019 09:23
Forum: DOS Batch Forum
Topic: Get Parent Directory as a variable
Replies: 6
Views: 2022

Re: Get Parent Directory as a variable

You want %a% instead of %%a. Variables are expanded by using % on both sides. %% before the name is for FOR loops, and command line or CALL arguments.
by kwsiebert
29 Jan 2019 09:44
Forum: DOS Batch Forum
Topic: Short WAV files-is there no standard player to call from batch?
Replies: 28
Views: 10007

Re: Short WAV files-is there no standard player to call from batch?

You should convert your wav files to mp3 so they will load quicker. when you convert wav to mp3 frequencies that are not audible to most people are cut of which results in a smaller file. So by converting wav to mp3 you loose information, that is why it doesn't make sense to convert an mp3 to wav. ...
by kwsiebert
19 Nov 2018 11:26
Forum: DOS Batch Forum
Topic: How to pass params (=files) in the order I clicked them in Winexp?
Replies: 5
Views: 884

Re: How to pass params (=files) in the order I clicked them in Winexp?

This order is dependent on the column you used to sort files in the explorer list view. E.g. if you ordered the files by the date in the list view then you receive the files ordered by date, too. Are you sure about this? I have a fair amount of experience seeing this issue, but only when sorting by...
by kwsiebert
09 Oct 2018 08:58
Forum: DOS Batch Forum
Topic: For while loop or just a goto statement
Replies: 5
Views: 1422

Re: For while loop or just a goto statement

No need for the +s here, you want:

ren file.txt file%%n.txt
by kwsiebert
01 Oct 2018 10:00
Forum: DOS Batch Forum
Topic: Batch file to move certain file to other disk creating links to original files
Replies: 1
Views: 1253

Re: Batch file to move certain file to other disk creating links to original files

You have an unpaired % in the echo statement, which should be an ! to begin with, like so:

Code: Select all

echo destination "%DEST_DIR%!FILE_INTERMEDIATE_DIR!!FILE_NAME_EXT!"
by kwsiebert
22 May 2018 08:49
Forum: DOS Batch Forum
Topic: strange file names
Replies: 4
Views: 1443

Re: strange file names

I've occasionally had to deal with corrupted file names that Windows won't work with. These always come from a RAR archive, and are supposed to be in Japanese, but were created incorrectly (99% of the Japanese files I pull from RARs are fine). WinRAR and 7Zip extract them with no problem, but then W...
by kwsiebert
30 Mar 2018 08:46
Forum: DOS Batch Forum
Topic: Renaming Files
Replies: 6
Views: 1848

Re: Renaming Files

Does every mp3 file start with a 3 digit number? Does every text file start with a 2 digit number? Do any artist names or song titles contain a - or . character? Do any artist names or song titles contain any other special characters? Are there any files in the directory other than the types you hav...
by kwsiebert
12 Jan 2018 09:11
Forum: DOS Batch Forum
Topic: copy with regular expression how to
Replies: 8
Views: 3048

Re: copy with regular expression how to

yes and it will not work because if I removed the wildcard (asterisk) it will translate to NY_20180110_08.xml Please include information like this in your initial request. While it was probably likely that <SysTime.HH> expanded to the 08 in the file names, making assumptions in code is a great way ...
by kwsiebert
15 Feb 2017 08:45
Forum: DOS Batch Forum
Topic: How to delete really loooooooooong file names?
Replies: 4
Views: 2256

Re: How to delete really loooooooooong file names?

ShadowThief wrote:Where are you getting these long names from? I can't even create a file with a name+extension that exceeds 200 characters.

I've had a downloading plugin for Firefox create files that Windows itself said were invalid.
by kwsiebert
09 Jan 2017 08:34
Forum: DOS Batch Forum
Topic: batch file not working totally correct.
Replies: 2
Views: 1091

Re: batch file not working totally correct.

When your batch is launched from another process (the PDF software in this case), the active directory it runs from will be whichever one the launching process was using. You will either need to use an absolute path to your image, or have the batch explicitly change to a known directory.
by kwsiebert
27 May 2016 08:16
Forum: DOS Batch Forum
Topic: Batch Script to Collect Network Information
Replies: 1
Views: 1815

Re: Batch Script to Collect Network Information

I tossed this together and it does what you requested, but be aware that if your regional settings aren't United States English, the time stamp may not work correctly. @echo off if not exist "c:\NetworkScripts\" md "c:\NetworkScripts\" cd /d "c:\NetworkScripts\" for /f ...
by kwsiebert
14 Apr 2016 07:45
Forum: DOS Batch Forum
Topic: Why are my arguments Invalid?
Replies: 23
Views: 19638

Re: Why are my arguments Invalid?

penpen wrote:
foxidrive wrote:This applied in MSDOS days, it's not true in modern Windows. Was this in modern documentation?

No.


penpen

Thanks for the newer link. Oddly, Google only ever returns the older one on the first page of results when I search, so I've always been assuming it was correct.