gogloc Posted February 11, 2022 Posted February 11, 2022 $pwd = "" Dim $aSpace[3] $digits = 15 For $i = 1 To $digits $aSpace[0] = Chr(Random(65, 90, 1)) ;A-Z $aSpace[1] = Chr(Random(97, 122, 1)) ;a-z $aSpace[2] = Chr(Random(48, 57, 1)) ;0-9 $pwd &= $aSpace[Random(0, 2, 1)] Next Run(@COMSPEC & ' /c "echo Random Password !!!!!!!!!!!!!!!!!!! (" & $digits & " digits): " & $pwd & @CRLF) > C:\Users\Admin\Desktop\test.txt ',@SYSTEMDIR,@SW_SHOW)
gogloc Posted February 11, 2022 Author Posted February 11, 2022 i have tried this and is not working , someone can help me ?
Solution SOLVE-SMART Posted February 11, 2022 Solution Posted February 11, 2022 Hi @gogloc, try this 😉 : Global $sFilePath = @DesktopDir & '\test.txt' Global $pwd = '' Global $digits = 15 Dim $aSpace[3] For $i = 1 To $digits $aSpace[0] = Chr(Random(65, 90, 1)) ; A-Z $aSpace[1] = Chr(Random(97, 122, 1)) ; a-z $aSpace[2] = Chr(Random(48, 57, 1)) ; 0-9 $pwd &= $aSpace[Random(0, 2, 1)] Next Run(@ComSpec & ' /K "echo Random Password !!!!!!!!!!!!!!!!!!! ("' & $digits & '" digits): "' & $pwd & '" > "' & $sFilePath & '"', '', @SW_SHOW) But why do you want to make it through the command line, when you're redirecting the output to a file anyway? You can write directly to an file without @ComSpec. Best regards Sven ________________Stay innovative! gogloc 1 ==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
gogloc Posted February 11, 2022 Author Posted February 11, 2022 i used the comspec just to test, but i think without comspec it's always ok
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now