Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 462 Vote(s) - 3.59 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to simply list all files of a folder using dir to text with UTF-8 encoding?

#1
Simple question:

On Windows 10, I found a quick and dirty solution to save the names of all the files in a folder by just simply:

- Creating a text file
- Type and save `dir > 1.txt` within it
- Rename the .txt file to .bat
- Run it. Done.

But, the text file this creates is in ANSI encoding, and thus won't show certain characters...
Is there a simple script I can add to the bat file before running it to make the generated texts encoded as UTF-8?
Reply

#2
You should add this command `chcp 65001` before `dir` command to change code page to UTF-8

@echo off
CHCP 65001>nul
dir>1.txt

Further reading about [CHCP][1] command


[1]:

[To see links please register here]

Reply

#3
This works for me:

PowerShell -Command "TREE /F | Out-File output.txt -Encoding utf8"
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through