Search found 75 matches

by Hackoo
05 Nov 2019 18:30
Forum: DOS Batch Forum
Topic: [Solved] How to filter all non-Microsoft services with WMIC and redirect the result to a text file ?
Replies: 6
Views: 2453

Re: [Solved] How to filter all non-Microsoft services with WMIC and redirect the result to a text file ?

Speaking of other scripts ... Pretty much the same thing as HTA in case no MS Office installed: <html><head><title>Non-Microsoft Services</title><meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta http-equiv="x-ua-compatible" content="IE=9"> <style type="text/css"> body {font: ...
by Hackoo
01 Nov 2019 23:13
Forum: DOS Batch Forum
Topic: [Solved] How to filter all non-Microsoft services with WMIC and redirect the result to a text file ?
Replies: 6
Views: 2453

Re: [Solved] How to filter all non-Microsoft services with WMIC and redirect the result to a text file ?

Hi :wink: Here is another version using vbscript in order to export the output results with Excel. Non-Microsoft-Services.vbs Option Explicit Dim objExcel,strComputer,objWMIService Dim State,colServices,x,objService,objWorksheet,objWorkbook ' Create a new and blank spreadsheet: Set objExcel = Create...
by Hackoo
31 Oct 2019 05:18
Forum: DOS Batch Forum
Topic: [Solved] How to filter all non-Microsoft services with WMIC and redirect the result to a text file ?
Replies: 6
Views: 2453

Re: How to filter all non-Microsoft services with WMIC and redirect the result to a text file ?

Sorry My bad i got it , I forgot to add the percent % in the batch file, so with a batch file works 5/5 @echo off WMIC service where "Not PathName like '%%Micro%%' AND Not PathName like '%%Windows%%'" get Name, DisplayName, PathName, Status >"%computername%.txt" Start "" "%computername%.txt" & exit ...
by Hackoo
31 Oct 2019 05:02
Forum: DOS Batch Forum
Topic: [Solved] How to filter all non-Microsoft services with WMIC and redirect the result to a text file ?
Replies: 6
Views: 2453

[Solved] How to filter all non-Microsoft services with WMIC and redirect the result to a text file ?

Hi :wink: WMIC service where "Not PathName like '%Micro%' AND Not PathName like '%Windows%'" get Name, DisplayName, PathName, Status So this command works 5/5 on the console but the problem is when I want to redirect the result to a text file, I get all the instances without any filter? while I see ...
by Hackoo
11 Oct 2019 18:25
Forum: DOS Batch Forum
Topic: date not showing
Replies: 3
Views: 4153

Re: date not showing

I recommend you using the date independently of the region day/month order, you can use "WMIC os GET LocalDateTime" as a source, since it's in ISO order: @echo off for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j se...
by Hackoo
05 Oct 2019 06:26
Forum: DOS Batch Forum
Topic: [Solved] How to escape special characters on InputFile with Drag and Drop ?
Replies: 5
Views: 4605

Re: How to escape special characters on InputFile with Drag and Drop ?

Exactly This & make the script down !
If i have for example a file named Key&.txt the script dosen't works !
by Hackoo
05 Oct 2019 04:30
Forum: DOS Batch Forum
Topic: [Solved] How to escape special characters on InputFile with Drag and Drop ?
Replies: 5
Views: 4605

[Solved] How to escape special characters on InputFile with Drag and Drop ?

Hi :wink: The goal of this code is to drag and drop a file onto the script and it encodes or decodes it in Base64 with Certutil Command. So my question is : "What can i do to escape special characters when a file to be encoded or decoded have them ?" Thank you ! @echo off Set "file=%~1" If "%file%"=...
by Hackoo
22 Sep 2019 07:42
Forum: DOS Batch Forum
Topic: get File Size batch script.
Replies: 2
Views: 3347

Re: get File Size batch script.

Hi :wink: Here is another code using a small vbscript to convert size to KB,MB and GB @echo off Title Get size of file or folder from a batch file by Hackoo 2019 SetLocal enabledelayedexpansion Set "MyBatchFile=%0" Set "MyFolder=%Temp%" Set "LogFile=%~dp0SizeLog.txt" If Exist "%LogFile%" Del "%LogFi...
by Hackoo
21 Sep 2019 01:29
Forum: DOS Batch Forum
Topic: get File Size batch script.
Replies: 2
Views: 3347

Re: get File Size batch script.

Hi :wink: @echo off Title Get size file from a batch file SETLOCAL enabledelayedexpansion Set "MyBatchFile=%0" Set "MyFile=C:\temp\test.txt" echo( echo This batch file !MyBatchFile! has a size of %~z0 bytes echo( for %%A in ("%MyFile%") do ( set "Size=%%~zA" echo The file "!MyFile!" has a size of !s...
by Hackoo
21 Sep 2019 00:00
Forum: DOS Batch Forum
Topic: How to search for files with file names listed in a text file (DIR)?
Replies: 1
Views: 3058

Re: How to search for files with file names listed in a text file (DIR)?

You can give a try with this batch script : @echo off Title Search and copy from file written by Hackoo on 21/09/2019 set "Source=source.txt" Set "SourceFolder=E:\Cam_Recorder" Rem You should modify this line to set your sourcefolder set "DestinationFolder=E:\MyData\backupfiles" Rem You should modif...
by Hackoo
18 Sep 2019 10:38
Forum: DOS Batch Forum
Topic: Auto Center Vbs Window
Replies: 3
Views: 2617

Re: Auto Center Vbs Window

You should take a look here :wink:
by Hackoo
03 Aug 2018 05:35
Forum: DOS Batch Forum
Topic: List files modified since set date
Replies: 2
Views: 710

Re: List files modified since set date

You can take a look at this ==> https://stackoverflow.com/questions/9349815/comparing-a-modified-file-date-with-the-current-date-in-a-batch-file Use FORFILES /? from the command line to get documentation on its use. This simple command will list all text files that have been modified today : forfile...
by Hackoo
01 Aug 2018 01:46
Forum: DOS Batch Forum
Topic: Reading a hidden password via a FINDSTR bug
Replies: 10
Views: 2795

Re: Reading a hidden password via a FINDSTR bug

A beautiful find ! :wink: works on my windows 10 too :lol: @echo off Title Multi-Lines Comments and Reading a hidden password via a FINDSTR bug rem.||( Today on 01/08/2018 ; I learned two nice codes : This is a multiline comments from here ==> https://www.dostips.com/forum/viewtopic.php?p=57621#p576...
by Hackoo
31 Jul 2018 10:14
Forum: DOS Batch Forum
Topic: [BAT] Get-FileHash (MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512)
Replies: 4
Views: 1064

Re: [BAT] Get-FileHash (MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512)

i wonder if is it possible to add a function in the same batch file that can check if this script exists on the right context menu Depends what context menu item you're talking about. Could be an item in the Send To which means that it is a link in the SenTo folder. Or it's a registry setting (see ...