Search found 345 matches

by Samir
17 Jul 2013 10:37
Forum: DOS Batch Forum
Topic: Run Batch File at Specific Time
Replies: 7
Views: 4512

Re: Run Batch File at Specific Time

Definitely that. If you don't exactly specify which executable to run, someone may execute his exe file instead of yours, with your rights as you call it. Gotcha. Makes sense. That's true - but think of all the other tools that you would also have to prepend the path. find, findstr, xcopy, robocopy...
by Samir
17 Jul 2013 10:34
Forum: DOS Batch Forum
Topic: For Loop
Replies: 8
Views: 2190

Re: For Loop

I think a dead simple example will help a bit:

Code: Select all

for %f in (1 2 3 4) do dir %f
What this will do is the following:

Code: Select all

dir 1
dir 2
dir 3
dir 4
Make sense?
by Samir
17 Jul 2013 10:16
Forum: DOS Batch Forum
Topic: Why no time in TIME.TXT :- echo %time% > TIME.TXT > NUL
Replies: 5
Views: 1758

Re: Why no time in TIME.TXT :- echo %time% > TIME.TXT > NUL

Very interesting. I remember from my C class that this would be some sort of order of operations and nesting, but didn't think that was possible in batch files. I'm sure I needed this a time or two before. 8)
by Samir
17 Jul 2013 10:10
Forum: DOS Batch Forum
Topic: CSV to QIF Using Batch?
Replies: 9
Views: 3679

Re: CSV to QIF Using Batch?

So this is because you are using a very very very very very old version of Quickbooks? Because as far as I know my wife does this very easily every month at her work and she uses ADP and Quickbooks. The newer versions of Quickbooks are bloated and nothing as simple and efficient as the original DOS...
by Samir
16 Jul 2013 22:37
Forum: DOS Batch Forum
Topic: A different method to trim spaces from a string
Replies: 16
Views: 6923

Re: A different method to trim spaces from a string

@Samir It seems to right trim only: Z:\>for %f in (" test test test ") do echo "%~nf" " test test test" @probyn This woorks very good, but is unsafe: trim asdad asd ^& echo Leak Maybe i am a little bit too mistrustful, but this is my maxime on external input. penpe...
by Samir
16 Jul 2013 21:35
Forum: DOS Batch Forum
Topic: CSV to QIF Using Batch?
Replies: 9
Views: 3679

Re: CSV to QIF Using Batch?

It's actually a much simpler task--ADP provides payroll data in a csv format and Quickbooks for DOS allows importing transactions via a QIF file. It has limitations, but will still save me about 50% of the time of entering the payroll manually like I've been doing. I've actually just completed a scr...
by Samir
16 Jul 2013 21:29
Forum: DOS Batch Forum
Topic: Run Batch File at Specific Time
Replies: 7
Views: 4512

Re: Run Batch File at Specific Time

Neat! I didn't even know about cscript. :) But I did want to stay at a 'pure' dos level if possible.

To make ping safer, you mean to explicitly specify where the exe is vs letting the path determine the location? :?:
by Samir
16 Jul 2013 14:45
Forum: DOS Batch Forum
Topic: CSV to QIF Using Batch?
Replies: 9
Views: 3679

CSV to QIF Using Batch?

I did a bunch of searches for this, but it seems like like nobody has really thought of putting these two together. I've been doing some scouring on the Internet and ran into the wonderful code on dostips to help me with some of the conversions details. So has no one really tried doing this before?
by Samir
16 Jul 2013 14:41
Forum: DOS Batch Forum
Topic: A different method to trim spaces from a string
Replies: 16
Views: 6923

Re: A different method to trim spaces from a string

I found a really quick and dirty way to trim spaces from a for variable by using %~nF. Even though ~n is reserved for filenames, it does a great job of stripping out white space. This one-liner will take care of both left and right trimming of spaces: ----------begin screen capture--------- C:\CMD>...
by Samir
16 Jul 2013 14:39
Forum: DOS Batch Forum
Topic: Run Batch File at Specific Time
Replies: 7
Views: 4512

Run Batch File at Specific Time

I needed something to do this that was pure command line DOS, so I made this. I'm looking for feedback for any improvements. 8)

Code: Select all

:START
PING -n 60 127.0.0.1 > NUL
SET CURTIME=%TIME:~0,-6%
IF NOT "%CURTIME%"=="10:00" GOTO START

CODE TO EXECUTE
by Samir
16 Jul 2013 12:41
Forum: DOS Batch Forum
Topic: Batch ffmpeg auto convert
Replies: 14
Views: 8310

Re: Batch ffmpeg auto convert

I hate to bump such an old thread, but I have to add some experience that I used in the late 1990s for mass converting mp3s. What I had created was a n-scalable batch file for mass parallel encoding files. So you have a source batch file on a file server with your files to be encoded. This batch fil...
by Samir
16 Jul 2013 12:32
Forum: DOS Batch Forum
Topic: Task Scheduler Isn't Running Bat File Correctly
Replies: 11
Views: 7675

Re: Task Scheduler Isn't Running Bat File Correctly

OK, I simplified my bat script to only map drive "S" instead of the rest of the actions. You see below how I map the drive...It states that it's already in use, even though it doesn't appear it's being used anywhere. C:\Users\fred\Downloads\BAT-Files>NET USE S: \\SERVER\netty\star /persis...
by Samir
16 Jul 2013 12:20
Forum: DOS Batch Forum
Topic: A different method to trim spaces from a string
Replies: 16
Views: 6923

Re: A different method to trim spaces from a string

I found a really quick and dirty way to trim spaces from a for variable by using %~nF. Even though ~n is reserved for filenames, it does a great job of stripping out white space. :D
by Samir
16 Jul 2013 12:17
Forum: DOS Batch Forum
Topic: open url from DOS
Replies: 1
Views: 1594

Re: open url from DOS

The only way I could think of doing that is if you could somehow run a second instance of the browser. I don't know, but there may be a way to feed an html file to start with the target parameter in there. Try that and see what happens.
by Samir
16 Jul 2013 12:15
Forum: DOS Batch Forum
Topic: Command 'grep' and 'awk'
Replies: 3
Views: 1584

Re: Command 'grep' and 'awk'

grep and awk are both unix commands so they don't work in dos. Now, I know there are "unix-for-dos" libraries out there that will add these features to dos. Then you can just use your script as is. 8)