Search found 74 matches
- 24 Jul 2023 03:29
- Forum: DOS Batch Forum
- Topic: Unable to produce truthful info about deletion or lack of thereof [SOLVED]
- Replies: 8
- Views: 2529
Re: Unable to produce truthful info about deletion or lack of thereof
dir /b /a-d "%THIS-WILL-BE-DELETED%" 1>NUL 2>&1
- 24 Jul 2023 02:33
- Forum: DOS Batch Forum
- Topic: Deleting files with sending them to Recycle Bin [SOLVED]
- Replies: 8
- Views: 4119
Re: Deleting but with sending items to Recycle Bin
test-1.bat
Code: Select all
@echo off
set "MyFile=C:\Test\1.txt"
mshta "javascript:new ActiveXObject('Shell.Application').NameSpace(10).CopyHere('%MyFile:\=\\%');close()"
- 24 Jul 2023 01:52
- Forum: DOS Batch Forum
- Topic: Delete file and folder under path with wildcard
- Replies: 3
- Views: 1503
Re: Delete file and folder under path with wildcard
test-1.bat
Code: Select all
@echo off
for /d %%i in ("C:\Users\UT*") do (
del /a /f /q "%%i\AppData\Logs\*"
for /d %%j in ("%%i\AppData\Logs\*") do (
rd /s /q "%%j"
)
)
- 25 Sep 2011 04:37
- Forum: DOS Batch Forum
- Topic: [solved] Hide keyboard input in a batch
- Replies: 13
- Views: 78731
Re: [solved] Hide keyboard input in a batch
@echo off set RealPwd=Batcher >"%temp%\in.com" echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5x set /p InputPwd=Enter password: <nul for /f "tokens=*" %%a in ('"%temp%\in.com"') do ( set "InputPwd=%%a" ) if "%InputPwd%" equ "%RealPwd%" ( ...
- 08 Sep 2011 05:29
- Forum: DOS Batch Forum
- Topic: Inseting underscore in between the test for a variable
- Replies: 5
- Views: 5804
Re: Inseting underscore in between the test for a variable
Code: Select all
@echo off
set "str=The Pebbles & Bamm-Bamm Show"
set str="%str: =_%"
echo,%str%
pause
- 21 Aug 2011 20:39
- Forum: DOS Batch Forum
- Topic: email
- Replies: 3
- Views: 4488
Re: email
Try following VBS from Microsoft Set objEmail = CreateObject("CDO.Message") objEmail.From = "admin1@fabrikam.com" objEmail.To = "admin2@fabrikam.com" objEmail.Subject = "Server down" objEmail.Textbody = "Server1 is no longer accessible over the network.&q...
- 19 Aug 2011 09:28
- Forum: DOS Batch Forum
- Topic: How can i solve this?
- Replies: 5
- Views: 5506
Re: How can i solve this?
Why not use command tree?
Code: Select all
tree /f C:\test
- 19 Aug 2011 00:40
- Forum: DOS Batch Forum
- Topic: Variable output is being truncated
- Replies: 2
- Views: 3397
Re: Variable output is being truncated
@echo off rem method 1 set "printername=printer_name_b&w" echo "%printername%" rem method 2 set "printername=printer_name_b^&w" echo %printername% rem method 3 setlocal enabledelayedexpansion set "printername=printer_name_b&w" echo !printername! p...
- 19 Aug 2011 00:35
- Forum: DOS Batch Forum
- Topic: can a batch tell if a number is bigger or smaller than anoth
- Replies: 5
- Views: 14950
Re: can a batch tell if a number is bigger or smaller than a
Code: Select all
@echo off
set n1=3
set n2=5
if %n1% lss %n2% (
echo smaller
) else if %n1% gtr %n2% (
echo bigger
) else if %n1% equ %n2% (
echo equal
)
pause
- 05 Aug 2011 22:37
- Forum: DOS Batch Forum
- Topic: IF EXIST [string in file] THEN [command]
- Replies: 2
- Views: 3642
Re: IF EXIST [string in file] THEN [command]
Code: Select all
findstr /c:"hello world" a.txt || echo hello world >>a.txt
- 16 May 2009 19:43
- Forum: DOS Batch Forum
- Topic: Batch for remote ftp dowlaods
- Replies: 7
- Views: 10622
- 12 May 2009 01:36
- Forum: DOS Batch Forum
- Topic: Script to find state of service on remote computers
- Replies: 1
- Views: 4564
- 12 May 2009 00:00
- Forum: DOS Batch Forum
- Topic: cmd and reg
- Replies: 2
- Views: 5204
If you export a registry key, the file is encoded in Unicode. But the for loop can't read this kind file. You need the type command.
Code: Select all
for /f "tokens=1,2" %%i in ('type reg.txt') do echo %%i %%j %%k
- 29 Apr 2009 09:02
- Forum: DOS Batch Forum
- Topic: Call Exported DLL Function
- Replies: 6
- Views: 12807