Search found 203 matches

by pieh-ejdsch
18 Jun 2018 02:23
Forum: DOS Batch Forum
Topic: convert file with 15 minute stock market data to hourly and daily
Replies: 4
Views: 1300

Re: convert file with 15 minute stock market data to hourly and daily

Hello purpleglow, is this an Example? @echo off setlocal enabledelayedExpansion set prompt=$g$s for /f "delims==" %%i in ('2^>nul set day[') do set "%%i=" set "day-=" for /f "usebackQtokens=1-5*delims=,.:" %%a in ("%userprofile%\desktop\.txt") do ( set /a "hour =(1%%d%%e -10830) /100" for /f "tokens...
by pieh-ejdsch
16 Jun 2018 09:36
Forum: DOS Batch Forum
Topic: .BAT script only running 1st command.
Replies: 3
Views: 901

Re: .BAT script only running 1st command.

if NOT ERRORLEVEL 2 ( move "%BaseDir%\%RefNum%" "%DestDir1%" > "%temp%\popup.vbs" echo msgbox "DO NOT FORGET TO GO INTO DAVID DOWNLOADS FOLDER” wscript.exe "%temp%\popup.vbs" ) else ( choice /C YN /M "IS THIS A JAMES DOWNLOAD(Y/N)?" if NOT ERRORLEVEL 2 ( move "%BaseDir%\%RefNum%" "%DestDir2%" > "%t...
by pieh-ejdsch
12 Jun 2018 09:26
Forum: DOS Batch Forum
Topic: List directory and files
Replies: 2
Views: 785

Re: List directory and files

Hello pp8771, you have started this batch twice in a command line prompt. Your batch has no setlocal. In the first run it saved the name of the last file into the variable file1. Your second run goes with the content of file1. You may use Enable delayedexpansion in the same codeline. But in your sit...
by pieh-ejdsch
04 Jun 2018 10:55
Forum: DOS Batch Forum
Topic: Stop Command Prompt Empty Line
Replies: 17
Views: 3400

Re: Stop Command Prompt Empty Line

I once tinkered with your createNest, because I first had to understand what should be done when. In addition, I had to create a similar test environment. Unfortunately, I do not have the "program" there. First of all, I can only repeat myself with the "program" quarreling around it. all other issue...
by pieh-ejdsch
04 Jun 2018 05:05
Forum: DOS Batch Forum
Topic: How to not merge folders already created
Replies: 5
Views: 1054

Re: How to not merge folders already created

Hello tweacle,
This want help you.

Code: Select all

Setlocal
PushD C:\Downloads
set "newFolder=newFolderName"
md "%newFolder%"
Move * "%newFolder%"
popD
Phil
by pieh-ejdsch
03 Jun 2018 06:01
Forum: DOS Batch Forum
Topic: Stop Command Prompt Empty Line
Replies: 17
Views: 3400

Re: Stop Command Prompt Empty Line

XY in questions often is a great problem. BTW if the echo is on- the CLI will print this empty line. Set prompt=$g$s Prog.exe Echo off Prog.exe Your batfile is with echo off. The output into redirected file doesn't have empty lines. Your example shows an output on the command line with the echo on. ...
by pieh-ejdsch
02 Jun 2018 12:05
Forum: DOS Batch Forum
Topic: Stop Command Prompt Empty Line
Replies: 17
Views: 3400

Re: Stop Command Prompt Empty Line

Hello, This prog.exe will print all these empty lines to your command line. It means the standard output isn't into handle1. Test the handle number for this output. Prog.exe 2>nul Prog.exe 3>nul ... Prog.exe 9>nul Or prog.exe to device CON still writes. Idon't now how to realize this con>nul ( prog....
by pieh-ejdsch
30 May 2018 08:52
Forum: DOS Batch Forum
Topic: How to mask a blank inside nested quotes?
Replies: 11
Views: 2271

Re: How to mask a blank inside nested quotes?

In for /f loop - You only must create a first command token with no space

Code: Select all

for /F usebackq %%L in (`if 1 equ 1 "%PROG%myprog.exe" ...... %%F`) do set %%L
Phil
by pieh-ejdsch
28 May 2018 14:56
Forum: DOS Batch Forum
Topic: start .exe from 08:00 to 18:00 at every workday
Replies: 15
Views: 2834

Re: start .exe from 08:00 to 18:00 at every workday

Hi, Since nobody offered a solution so far ... I created the script to wait. It uses robocopy as mentioned in the other post. The start time to wait must be set before the first execution time. But it should at least be smaller or equal. The break time and the last possible execution time must also ...
by pieh-ejdsch
25 May 2018 04:11
Forum: DOS Batch Forum
Topic: How do i move files from series of folders
Replies: 7
Views: 1101

Re: How do i move files from series of folders

You mean so?

Code: Select all

PushD D:\rootfolder
For /r %%i in (*) do if "%%~fi" neq "%~f0" if NOT exist %%~nxi move "%%i"
Popd
Phil
by pieh-ejdsch
23 May 2018 09:57
Forum: DOS Batch Forum
Topic: start .exe from 08:00 to 18:00 at every workday
Replies: 15
Views: 2834

Re: start .exe from 08:00 to 18:00 at every workday

@squashman
He wants to start the batch code every hour.
by pieh-ejdsch
23 May 2018 08:57
Forum: DOS Batch Forum
Topic: start .exe from 08:00 to 18:00 at every workday
Replies: 15
Views: 2834

Re: start .exe from 08:00 to 18:00 at every workday

Hello,
In timed batch file execution this was discussed.
viewtopic.php?f=3&t=8268&p=56092#p54961
Phil
by pieh-ejdsch
17 May 2018 09:28
Forum: DOS Batch Forum
Topic: Random number generation problem
Replies: 2
Views: 744

Re: Random number generation problem

This can be short :randomization cls Set /a RadomA =%random% %%10 +1 Rem 1 - 100 Set /a randomBat =%random% %%99 +1 rem 101 - 137 if %randomA% gtr 5 set /a randomBat = %random% %%(137 -100 -1) +101 rem 138 - 154 if %randomA% gtr 9 set /a randomBat =%random% %%(154 -137 -1) +138 call %randomBat%.bat ...
by pieh-ejdsch
27 Apr 2018 09:48
Forum: DOS Batch Forum
Topic: Batch IF-Condition click once for getting the loot only once
Replies: 3
Views: 884

Re: Batch IF-Condition click once for getting the loot only once

Hallo, Deine Idee kannst Du auf einem Blatt erstmal skizzieren bzw. ausschreiben. Dann legst Du eine Variable fest, mit deren Hilfe Du bestimmst wann etwas gemacht werden darf. Eine IF-Bedingung ist nichts anderes als: Was wäre wenn. Wenn Geld erhalten wurde kann kein weiteres Geld erhalten werden. ...
by pieh-ejdsch
23 Apr 2018 11:53
Forum: DOS Batch Forum
Topic: 'for' statement in macro will not accept 'tokens' argument from another 'for' statement. Why?
Replies: 5
Views: 1057

Re: 'for' statement in macro will not accept 'tokens' argument from another 'for' statement. Why?

a little workaround to do this ... set "varCount=!varName!" set "varCount=!varCount:?=x" set "varCount="=x!" set "varCount="!varCount:,=" "!"" set "#=0" for %%L in (!varCount!) do ( set /a #+=1 if !#! equ !TOKEN#! for /f "delims=," %%S in ("!varName!") do set "newVar=%%S" set "varName=!varName:*,=!,...