Search found 553 matches

by miskox
31 Oct 2023 10:13
Forum: DOS Batch Forum
Topic: Another amazing porting...
Replies: 14
Views: 76202

Re: Another amazing porting...

If you need this data in a file then makecab/expand solution might work for you. 1. Create a .cab file that contains your file. 2. Create a dump of this .cab file (for example with https://www.dostips.com/forum/viewtopic.php?p=14361#p14361) 3. And copy/paste the code in https://www.dostips.com/forum...
by miskox
29 Oct 2023 11:53
Forum: DOS Batch Forum
Topic: Another amazing porting...
Replies: 14
Views: 76202

Re: Another amazing porting...

@miskox I didn't understand what you wrote The data are 128 bytes and become 172 in coding based on 64. How much data you need to compress? Can makecab/expand be useful? Where are you going to store this compressed data? https://www.dostips.com/forum/viewtopic.php?p=14704#p14704 https://www.dostips...
by miskox
27 Oct 2023 08:27
Forum: DOS Batch Forum
Topic: Another amazing porting...
Replies: 14
Views: 76202

Re: Another amazing porting...

Amazing.

Regarding your compression: I can't help you but can't you use unzip.exe because you say you could use .exe file?

Saso
by miskox
24 Oct 2023 10:32
Forum: DOS Batch Forum
Topic: Is it worth learning Powershell?
Replies: 10
Views: 31335

Re: Is it worth learning Powershell?

I will just add this: I think PS is very good for (some?) admin repetive tasks (why I wrote 'some?'? - because I don't take care of servers but this is based on what I read so I don't have such experiences). I use PS almost daily for some special task: I have (my customer really) 150+ Excel files. A...
by miskox
18 Oct 2023 10:54
Forum: DOS Batch Forum
Topic: Replacing a locked file
Replies: 3
Views: 13940

Re: Replacing a locked file

Maybe you could add a

Code: Select all

timeout /T 10
before replacing the file so you have some time for the parent process to exit.

Saso
by miskox
16 Oct 2023 13:38
Forum: DOS Batch Forum
Topic: Batch File To Create Folder With Current Date
Replies: 14
Views: 30288

Re: Batch File To Create Folder With Current Date

See viewtopic.php?p=60703#p60703

And I suggest you use yyyy-mm-dd and not mm-dd-yyyy.

Saso
by miskox
15 Oct 2023 09:28
Forum: DOS Batch Forum
Topic: Variable inside an IF not showing correctly
Replies: 18
Views: 100380

Re: Variable inside an IF not showing correctly

@aacini: thanks! This is what I get for not following SO. In any case: my contribution was intended to draw attention to the possibility of such an error.

SO link is very useful! Thanks!

Saso
by miskox
13 Oct 2023 11:22
Forum: DOS Batch Forum
Topic: Showing a continuous countdown while executing other commands in background
Replies: 2
Views: 13250

Re: Showing a continuous countdown while executing other commands in background

You could use a progress bar. See: https://www.dostips.com/forum/viewtopic.php?t=5503 with this: https://www.dostips.com/forum/viewtopic.php?p=33575#p33575 Now Escape sequences should be used instead of an .exe. https://www.dostips.com/forum/viewtopic.php?t=3495 https://www.dostips.com/forum/viewtop...
by miskox
13 Oct 2023 07:16
Forum: DOS Batch Forum
Topic: Variable inside an IF not showing correctly
Replies: 18
Views: 100380

Re: Variable inside an IF not showing correctly

One thing to add: robocopy "%IPADDRESS%\Dnload\VNC" "%wkdir%" "%FileName%" Echo %ERRORLEVEL% IF NOT ERRORLEVEL 1 GOTO FileCopied ERRORLEVEL that is compared in this case is the one from the ECHO command and it would probably always return success. You would have to use something like this: set errle...
by miskox
10 Oct 2023 10:32
Forum: DOS Batch Forum
Topic: Variable inside an IF not showing correctly
Replies: 18
Views: 100380

Re: Variable inside an IF not showing correctly

Code: Select all

set wkdir=%cd%
			Echo "wRkdir = -" !wRkdir!
wkdir and wRkdir variables.

Saso
by miskox
08 Oct 2023 10:00
Forum: DOS Batch Forum
Topic: I'd like to start Filezilla on a network PC
Replies: 5
Views: 14219

Re: I'd like to start Filezilla on a network PC

Maybe you could use CURL or FTP?

Saso
by miskox
08 Oct 2023 09:52
Forum: DOS Batch Forum
Topic: Is there a way to subtract 2 days from this batch file?
Replies: 5
Views: 14774

Re: Is there a way to subtract 2 days from this batch file?

I have these two date functions (I really don't remember where I found them - I did not write them). But one does not work as intented. I used one to add 7 days to calculate dates (for wednesdays) but at one time there were errors: date_calc_error.cmd @echo off set start_dd=21 set start_mm=12 set st...
by miskox
30 Jul 2023 23:46
Forum: DOS Batch Forum
Topic: If...Then Not Working
Replies: 4
Views: 1744

Re: If...Then Not Working

Code: Select all

@echo off
set "StrAJ=ABCDEFGHIJ"
set /p CName="Please enter new customer as LastName, FirstName: "
set "CLetter=%CName:~0,1%"

set "CGroup=Client Files K-Z"
(echo,%StrAJ% | findstr /i "%CLetter%" >nul)&&set "CGroup=Client Files A-J"
echo,%CGroup%
pause
by miskox
27 Jul 2023 04:07
Forum: DOS Batch Forum
Topic: How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?
Replies: 2
Views: 1513

Re: How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?

I tested it with 7za.exe (console version on 7zip website). If there is an error (maybe just wrong password or any other - can't tell - didn't check that) ERRORLEVEL was set to 2. If OK ERRORLEVEL was 0.

Code: Select all

7za.exe t -pWRONGPASS test.7z >nul 2>nul
echo %errorlevel%
Saso