Search found 128 matches

by PAB
13 Feb 2021 03:41
Forum: DOS Batch Forum
Topic: Put the End Time the computer will sleep.
Replies: 13
Views: 3103

Re: Put the End Time the computer will sleep.

Thanks again for the reply T3RRY , it is very much appreciated. I still can't get my head round how to get this to work. If I run the code it asks for the minutes, I enter those and press enter and I don't get the revised time. Thank you for the time and effort you have put into this. It is not impo...
by PAB
12 Feb 2021 04:26
Forum: DOS Batch Forum
Topic: Put the End Time the computer will sleep.
Replies: 13
Views: 3103

Re: Put the End Time the computer will sleep.

Thanks again for the reply T3RRY and detailed explanations, it is very much appreciated. I will have to leave this. I am a 60+ somebody who just likes doing things to keep my brain active. I am not a programmer in any way, but unfortunately this is beyond my capabilities. I did try and I just couldn...
by PAB
11 Feb 2021 16:42
Forum: DOS Batch Forum
Topic: Put the End Time the computer will sleep.
Replies: 13
Views: 3103

Re: Put the End Time the computer will sleep.

I have to input the minutes twice, and then after it has finished, a message briefly pops up. I had to add a pause to see the output. Here is the code . . . @Echo off Set /P "Minutes=Enter Minutes: " Call :Offset Minutes pause :Offset <Days| Minutes | Hours | Seconds> Echo(%*|%__APPDIR__%findstr.exe...
by PAB
11 Feb 2021 13:55
Forum: DOS Batch Forum
Topic: Put the End Time the computer will sleep.
Replies: 13
Views: 3103

Re: Put the End Time the computer will sleep.

Thanks again for the reply T3RRY, it is very much appreciated.

I couldn't get this to work in a Batch script because it didn't ask for the minutes to input.

Am I being a bit slow?
by PAB
11 Feb 2021 03:22
Forum: DOS Batch Forum
Topic: Put the End Time the computer will sleep.
Replies: 13
Views: 3103

Re: Put the End Time the computer will sleep.

Thanks for the reply T3RRY, it is very much appreciated.

That works. It is obviously one of those situations where PS is far better at achieving something rather than using a Batch script.

Stay well and be SAFE.
by PAB
10 Feb 2021 06:10
Forum: DOS Batch Forum
Topic: Put the End Time the computer will sleep.
Replies: 13
Views: 3103

Re: Put the End Time the computer will sleep.

Good afternoon, I also tried this which works as long as the the MINUTES are not equal to or greater than 120 . . . @echo off set /A TimeTest=90 set hh=%time:~0,2% if "%hh:~,1%"=="0" set hh=%hh:~1,2% set mm=%time:~3,2% if "%mm:~,1%"=="0" set mm=%mm:~1,2% set /A mm=%mm%+%TimeTest% ::if %mm% GEQ 60 se...
by PAB
09 Feb 2021 12:45
Forum: DOS Batch Forum
Topic: Put the End Time the computer will sleep.
Replies: 13
Views: 3103

Put the End Time the computer will sleep.

Good evening, The code below works . . . set /p "time=>Please enter the Time in minutes and press <Enter>: " set /a time=%time%*60 if %time% GEQ 1 ( echo The computer is getting ready to go to Sleep . . . timeout %time% /nobreak > nul %SystemRoot%\system32\rundll32.exe powrprof.dll, SetSuspendState ...
by PAB
07 Feb 2021 10:31
Forum: DOS Batch Forum
Topic: Problem extracting data from FILTER list with NO duplicates.
Replies: 3
Views: 1373

Re: Problem extracting data from FILTER list with NO duplicates.

Thank you for the reply, it is appreciated. I took out ALL the deletes and I still get the same message! I think it has something to do with this because it appears AFTER the line . . . echo. & echo SUMMARY [ TODAY ONLY ] WAS FOUND. for /f "tokens=* delims= " %%a in (%Today%) do ( find "%%a" < %TFN%...
by PAB
07 Feb 2021 10:03
Forum: DOS Batch Forum
Topic: Problem extracting data from FILTER list with NO duplicates.
Replies: 3
Views: 1373

Re: Problem extracting data from FILTER list with NO duplicates.

Good afternoon, Well, I have changed the code and managed to get it to work. There is however, ONE Error that I can't seem to track down. When there is data available, I get the message [ I have marked it ]. . . SUMMARY [ TODAY ONLY ] WAS FOUND. The system cannot find the file specified. <<<<<<<<< >...
by PAB
05 Feb 2021 03:48
Forum: DOS Batch Forum
Topic: Problem extracting data from FILTER list with NO duplicates.
Replies: 3
Views: 1373

Problem extracting data from FILTER list with NO duplicates.

Good morning, I hope you are all keeping well and SAFE. I have been working on something for days and days, and I am so very close to it working but I can't seem to get the last bit to work. I really have tried very hard. He is what I am attempting to do . . . [1] If the file does NOT exist, show a ...
by PAB
30 Aug 2020 12:54
Forum: DOS Batch Forum
Topic: Can't get integration to work!
Replies: 0
Views: 2359

Can't get integration to work!

Good evening, I have two lines of code which work individually . . . for /f "tokens=*" %%A in ('dir /b /a:-d') do echo %%~nxA %%~zA >> "Folders_Files.txt" dir /b /a:-d | findstr /v /i "Folders_Files.txt List_Folder_Files_1.bat" >> "Folders_Files.txt" I have tried so many variations but I can't seem ...
by PAB
29 Aug 2020 06:56
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 15
Views: 5052

Re: Letter used in a variable.

@Echo off & Setlocal DisableDelayedExpansion (Set \n=^^^ %=Newline DNR=% ) Set CHECKDISK=For %%n in (1 2) Do If %%n==2 (%\n% For /F "Tokens=1 Delims={}" %%1 in ("!Key!") Do (%\n% echo/^& echo Run chkdsk %%~1: /F Y/N?%\n% For /F "Delims=" %%. in ('Choice /N /C:yn') Do If "%%."=="N" Endlocal^&Goto :M...
by PAB
26 Aug 2020 16:12
Forum: DOS Batch Forum
Topic: Change position of environment variables output!
Replies: 4
Views: 2649

Re: Change position of environment variables output!

wmic output takes a little more work, refer to the remarks for more. Well, thanks to your code and explanations I was able to achieve what I needed, thank you. In fact I have extended it to provide two more outputs as below. The first one [ CODE 1 ] is your one and works perfectly. My question is p...
by PAB
26 Aug 2020 15:50
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 15
Views: 5052

Re: Letter used in a variable.

fyi, choice does accept numbers 0-9 in addition to alphabetical characters. Note using a for /f loop to iterate over the choice command will return letters in upper case, even if the choice options are declared using lower case. You can also obtain the available drives using wmic to define (and dis...
by PAB
17 Aug 2020 08:48
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 15
Views: 5052

Re: Letter used in a variable.

Thank you ALL for the replies. I am a bit poorly at the moment so I am sorry that I have not got back to any of you. When I feel a little better I will thoroughly go through this whole thread and take it all in, and answer each of your posts individually. You are all brilliant at what you do. I thou...