Search found 22 matches

by sal21
08 Jul 2019 11:46
Forum: DOS Batch Forum
Topic: Months SCHTASKS
Replies: 2
Views: 5090

Months SCHTASKS

SCHTASKS /CREATE /SC MONTHLY /D 15 /TN "MyTasks\Notepad task" /TR "C:\Windows\System32\notepad.exe" /ST 11:00

Instead ti set alle months, how to for janary, March and June?
Tks
by sal21
21 Jun 2019 08:02
Forum: DOS Batch Forum
Topic: send email via batch
Replies: 3
Views: 5511

send email via batch

this lines open the email .oft, but not send directlly the email...
how to send email directlly via cmd?
tks.

Code: Select all

@echo off 
cd C:\SERVIZIO\
start "C:\Program Files\Microsoft Office\Office14\OUTLOOK.EXE" "Monitoraggio.oft" 
by sal21
09 May 2019 06:52
Forum: DOS Batch Forum
Topic: Find string in a big txt file and rturn the number line where the string is
Replies: 13
Views: 8604

Re: Find string in a big txt file and rturn the number line where the string is

aGerman wrote:
07 May 2019 06:41
Does it work?
How should I know the content of your 985.txt and if all paths are correct and existing?

Steffen
OPS.....
in txt file i can have:
AAAA
AAAA
AAAA

The bat capture all AAAA...

in my work i need to capture only the first occurrence of AAAA, and exit from the code, possible?
by sal21
07 May 2019 06:50
Forum: DOS Batch Forum
Topic: Find string in a big txt file and rturn the number line where the string is
Replies: 13
Views: 8604

Re: Find string in a big txt file and rturn the number line where the string is

aGerman wrote:
07 May 2019 06:41
Does it work?
How should I know the content of your 985.txt and if all paths are correct and existing?

Steffen
resolved!
wRONG PATH!
tHE CODE NOW WORK PERFECT!

Bro, love Pizza?
When you come in Napoli....

Tks also for your time.
Sal
by sal21
07 May 2019 06:35
Forum: DOS Batch Forum
Topic: Find string in a big txt file and rturn the number line where the string is
Replies: 13
Views: 8604

Re: Find string in a big txt file and rturn the number line where the string is

aGerman wrote:
07 May 2019 06:16
No, you have to redirect the ECHO output to the file.

Code: Select all

@for /f "delims=:" %%i in ('findstr /nc:"your string" "your file.txt"') do >"c:\testdir\result.txt" echo %%i
Steffen
Is this correct?
by sal21
07 May 2019 00:54
Forum: DOS Batch Forum
Topic: Find string in a big txt file and rturn the number line where the string is
Replies: 13
Views: 8604

Re: Find string in a big txt file and rturn the number line where the string is

Just a guess ... @for /f "delims=:" %%i in ('findstr /nc:"your string" "your file.txt"') do exit /b %%i No idea if that is what "return the number" means in your case. Steffen HI Steffen, TKS FOR CODE.! To save the result of bat in c:\testdir\result.txt, in this case the number of line found? is th...
by sal21
05 May 2019 11:20
Forum: DOS Batch Forum
Topic: Find string in a big txt file and rturn the number line where the string is
Replies: 13
Views: 8604

Re: Find string in a big txt file and rturn the number line where the string is

but i need to use vb6. I'm not experienced with VB6. This is a Batch forum and I offered a Batch solution... Steffen ok i can trap your code in a file .bat? In this case i know the code in vb6 to lunch the bat. if is possible, can you integrate your code to return the number of line finded in c:\te...
by sal21
05 May 2019 10:43
Forum: DOS Batch Forum
Topic: Find string in a big txt file and rturn the number line where the string is
Replies: 13
Views: 8604

Re: Find string in a big txt file and rturn the number line where the string is

for /f "delims=:" %%i in ('findstr /nc:"your string" "your file.txt"') do set "n=%%i" ... untested though. i need to integrate the batch in my vb6 application Any good reason why you don't do this task in VB directly? Steffen tks! Sorry for delay. but i need to use vb6. possible to use the VB6 Shel...
by sal21
05 May 2019 10:40
Forum: DOS Batch Forum
Topic: Find string in a big txt file and rturn the number line where the string is
Replies: 13
Views: 8604

Re: Find string in a big txt file and rturn the number line where the string is

tks!
Sorry for delay.

but i need to use vb6.

possible to use the VB6 Shell?

If yes, have an idea for vb6 code?
Tks
by sal21
03 May 2019 03:37
Forum: DOS Batch Forum
Topic: Find string in a big txt file and rturn the number line where the string is
Replies: 13
Views: 8604

Find string in a big txt file and rturn the number line where the string is

i'm working with vb6.

possible to:
Find a string in a big txt file and return the number of line where the string is found?
Naturally store the line number in a variable

note:
i need to integrate the batch in my vb6 application

tks and sorry for my bad english.
by sal21
02 Aug 2018 03:40
Forum: DOS Batch Forum
Topic: copy and kill file
Replies: 2
Views: 2998

copy and kill file

batch, please.. tkx. have two lan dir: source dir: \\mylnadir1\dir1\ destination dir: \\mylnadir2\dir2\ from source dir i need to loop all .txt files (only this type with .txt), check if in destionation dir are present if not copy, from source and paste in destination, naturally kill file from sourc...
by sal21
24 May 2018 04:04
Forum: DOS Batch Forum
Topic: start .exe from 08:00 to 18:00 at every workday
Replies: 15
Views: 11077

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

ShadowThief wrote:
24 May 2018 03:45
sal21 wrote:
24 May 2018 01:09
Then do you want the next instance to run at 9 am or 9:10 am? YES!
That wasn't a yes/no question. If you start the script at 8:10, should the next instance run at 9:00 or should the next instance run at 9:10?
Sorry...
9:10
by sal21
24 May 2018 01:09
Forum: DOS Batch Forum
Topic: start .exe from 08:00 to 18:00 at every workday
Replies: 15
Views: 11077

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

What do we do if you start the batch file at 7:50 am. Do you want it to wait until 8 am to run any additional code in the batch file? What do we do if you start the batch file at 8:10 am. Do you want it to run immediately? Then do you want the next instance to run at 9 am or 9:10 am? Do you want it...
by sal21
23 May 2018 08:16
Forum: DOS Batch Forum
Topic: start .exe from 08:00 to 18:00 at every workday
Replies: 15
Views: 11077

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

How do you expect a program to start automatically at a specific time if you do not have some type of service or daemon running in the background to monitor the time? .. i run it for the first time manullay And then it stays open forever on an infinite loop and you just pray that it never gets clos...
by sal21
23 May 2018 07:59
Forum: DOS Batch Forum
Topic: start .exe from 08:00 to 18:00 at every workday
Replies: 15
Views: 11077

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

Squashman wrote:
23 May 2018 06:54
How do you expect a program to start automatically at a specific time if you do not have some type of service or daemon running in the background to monitor the time?
.. i run it for the first time manullay