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