Search found 10 matches

by rodrigo.brasil
19 Mar 2024 12:31
Forum: DOS Batch Forum
Topic: How to delete lines of file without changind date?
Replies: 1
Views: 4665

How to delete lines of file without changind date?

No, this is not possible. But there is a workaroud: You edit the file Then you change the date Now I have a problem: Can I edit the file inplace ? If YES , I need to store the date in memory an then change it If NO , I need create a new file, toch it, delete the old and rename the new one Until now,...
by rodrigo.brasil
16 Dec 2023 11:58
Forum: DOS Batch Forum
Topic: How to list all files in HD?
Replies: 0
Views: 20978

How to list all files in HD?

Ok, the answer is simple, just: dir /s Or if you want to list in ALL disks, just do: for /f "tokens=2* usebackq delims==" %x in (`wmic logicaldisk get caption /value`) do @(for /f "delims=:" %y in ("%x") do @(dir %y:\)) But there is a bug in the dir /s command. If I am administrator (privilege) when...
by rodrigo.brasil
23 Nov 2023 07:14
Forum: DOS Batch Forum
Topic: cmd.exe forensic?
Replies: 1
Views: 18506

cmd.exe forensic?

What are the forensic artifacts the cmd.exe produce?

I know the powershell create a lot more itens in windows event (like, the entire script you run, when you start a powershell session, etc...). Is the cmd.exe a kind of stealthy way to execute code?
by rodrigo.brasil
04 Aug 2023 09:24
Forum: DOS Batch Forum
Topic: Native compress files in windows [SOLVED]
Replies: 6
Views: 5702

Re: Native compress files in windows

ShadowThief wrote:
03 Aug 2023 17:19
There are several options available, but makecab is probably your best bet. https://stackoverflow.com/questions/280 ... s-with-bat
Great answer! This is exactly what I was looking! I couldn't find it myself!
by rodrigo.brasil
03 Aug 2023 16:42
Forum: DOS Batch Forum
Topic: Native compress files in windows [SOLVED]
Replies: 6
Views: 5702

Re: Native compress files in windows

mataha wrote:
03 Aug 2023 16:34
I believe tar is available on Windows these days:

Code: Select all

tar --help
Lol, yes, tar is avaliable, but ONLY in new version of windows. I forget to say about it. Is there other tool to do it in old windows? Or in other words, If the system don't have tar, what are my options?
by rodrigo.brasil
03 Aug 2023 16:23
Forum: DOS Batch Forum
Topic: Native compress files in windows [SOLVED]
Replies: 6
Views: 5702

Native compress files in windows [SOLVED]

I have 10 files and want to join it in one file! There are 2 ways to do it: Compress the files Join the files There are a lot of programs that do it with command line. But, with ONLY the default windows, is there any tool that I can compress the files in one computer and decompress it in another? If...
by rodrigo.brasil
25 Jun 2023 14:53
Forum: DOS Batch Forum
Topic: Is there a script to safely delete a file?
Replies: 3
Views: 3662

Is there a script to safely delete a file?

To safely delete a file, you need: Rewrite all file content with random data Rename the file with random data Delete the file There are a lot of tools to do it, like SDelete . But this tools you will need to download and install... If there is a native utility or a good script, my life will be easie...
by rodrigo.brasil
25 Jun 2023 14:13
Forum: DOS Batch Forum
Topic: How to escape comma in wmic?
Replies: 10
Views: 10825

Re: How to escape comma in wmic?

I get new ideas! And finaly it worked!!! wmic process call create 'cmd /E:ON /V:ON /c "(cmd /c exit 44 ) & SET coma=!=exitcodeAscii!& echo Please accept the comma !coma! YESSSS!!!!! >c:\test.txt" ' &timeout 1& type c:\test.txt Now I can run more complex commands: wmic process call create 'cmd /E:ON ...
by rodrigo.brasil
24 Jun 2023 21:18
Forum: DOS Batch Forum
Topic: How to escape comma in wmic?
Replies: 10
Views: 10825

Re: How to escape comma in wmic?

Well, you can run commands remotely in another computer network. Just pass the user and password. I could not believe that I can't escape the comma. I build another strategy like to send the command in base64 and decode it.
by rodrigo.brasil
20 Jun 2023 16:41
Forum: DOS Batch Forum
Topic: How to escape comma in wmic?
Replies: 10
Views: 10825

How to escape comma in wmic?

This is making me crazy. I want to run a cmd inside wmic . wmic process call create 'cmd /c "echo hello wold >c:\test.txt" ' &timeout 1& type c:\test.txt This command work well. (You need some delay to read the file). If I want to print all character from the keyboard, I can make this: wmic process ...