Search found 139 matches

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

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: 8916

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: 8916

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: 3265

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: 3265

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: 3265

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: 17102

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: 11590

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: 4816

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: 11590

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: 11590

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...
by PAB
12 Aug 2020 08:35
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 15
Views: 11590

Re: Letter used in a variable.

Thank you BOTH for the replies, it is very much appreciated. penpen So using your code I would end up with . . . set "Drive=" set /p "Drive=>Please enter the drive letter and press <Enter>: " for /f "delims=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" %%a in ("!Drive!") do (echo wrongInput ...
by PAB
11 Aug 2020 14:54
Forum: DOS Batch Forum
Topic: Letter used in a variable.
Replies: 15
Views: 11590

Letter used in a variable.

I am on virtually the last bit of finishing my file thanks to all the excellent help, responses, and direction from the experts here. Besides the responses and advice given here in previous threads I have been doing my homework and my own investigations. On https://ss64.com/nt/if.html it says . . . ...
by PAB
11 Aug 2020 14:42
Forum: DOS Batch Forum
Topic: Only accept a numeric number.
Replies: 20
Views: 13064

Re: Only accept a numeric number.

Thank you Compo and Aacini for the replies.
I will look at them in more detail in the week and reply.
Sorry I haven't replied before but I have had a couple of intensive days at the hospital having tests etc.
by PAB
08 Aug 2020 14:23
Forum: DOS Batch Forum
Topic: [SOLVED] Output gets directed to the wrong folder!
Replies: 2
Views: 3037

Re: Output gets directed to the wrong folder!

Hello OJBakker , Your "Report.bat" is located in PBU\bin So your code expands to PBU\bin\Reports\Reports.txt The code below will set the Output_File to PBU\Reports\Reports.txt cd /d "%~dp0" set "Output_File=..\Reports\Report.txt" You code also works as expected! Thank you, it is appreciated.