zedogas Posted June 22, 2010 Share Posted June 22, 2010 Hi friends I need a little help. I have a batch command that works fine (.bat or .cmd): for /f "tokens=*" %%i in ('Net Localgroup sector ^| find /I /V "Alias" ^| find /I /V "Membros" ^| find /I /V "coment rio" ^| find /I /V "------" ^| find /I /V "comando"') Do Net Localgroup sector "%%i" /Delete It deletes FINE all users and groups in localgroup "sector". So, when I send to autoit the command: #include <process.au3> _RunDOS("for /f " & '"tokens=*"' & " %i in ('Net Localgroup sector ^| find /I /V " & '"Alias"' & " ^| find /I /V " & '"Membros"' & " ^| find /I /V " & '"coment rio"' & " ^| find /I /V " & '"------"' & " ^| find /I /V " & '"comando"' & ") Do Net Localgroup sector " & "%i" & " /Delete") doesn't WORK. I tried a more % in %i (%%i), but doesn't work too... So, any ideas? What's wrong here? Thanks. Link to comment Share on other sites More sharing options...
Mat Posted June 22, 2010 Share Posted June 22, 2010 I would not advise mix single and double quotes like you have, I would have done this: _RunDOS("for /f ""tokens=*"" %%i in ('Net Localgroup sector ^| find /I /V ""Alias"" ^| find /I /V ""Membros"" ^| find /I /V ""coment rio"" ^| find /I /V ""------"" ^| find /I /V ""comando""') Do Net Localgroup sector ""%%i"" /Delete") Also, I would not use dos... Use AutoIt instead. There are net user functions on the forum, so see if you can find what you want by searching. Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
zedogas Posted June 22, 2010 Author Share Posted June 22, 2010 Dude, you're amazing. Thanks (very much) for help me. Closed case. Link to comment Share on other sites More sharing options...
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