ninhgiangbs Posted September 29, 2013 Share Posted September 29, 2013 Hi,Anyone can help me converting the following batch file commands into AutoIt commands?Regards file .bat TAKEOWN /f "%SystemRoot%\Media\Windows Navigation Start.wav" /a CACLS "%SystemRoot%\Media\Windows Navigation Start.wav" /E /G Administrators:F DEL /Q "%SystemRoot%\Media\Windows Navigation Start.wav" pls help me converting --> .Au3 (autoit) Link to comment Share on other sites More sharing options...
water Posted September 29, 2013 Share Posted September 29, 2013 (edited) Welcome to AutoIt and the forum! Only "Del" can be changed to "FileDelete". The rest needs to be executed by using "Run". Edited September 29, 2013 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
ninhgiangbs Posted September 29, 2013 Author Share Posted September 29, 2013 Thank you, I have tried and failed, it requires the use of 3 command /1 CMD Link to comment Share on other sites More sharing options...
water Posted September 29, 2013 Share Posted September 29, 2013 Can you post what you have tried so far? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
ninhgiangbs Posted September 29, 2013 Author Share Posted September 29, 2013 run('"' & @systemdir & 'TAKEOWN.exe" /f "%SystemRoot%MediaWindows Navigation Start.wav" /a') run('"' & @systemdir & 'CACLS.exe" "%SystemRoot%MediaWindows Navigation Start.wav" /E /G Administrators:F') run('"' & @systemdir & 'DEL.exe" /Q "%SystemRoot%MediaWindows Navigation Start.wav"') Link to comment Share on other sites More sharing options...
ninhgiangbs Posted September 29, 2013 Author Share Posted September 29, 2013 pls help me Link to comment Share on other sites More sharing options...
water Posted September 30, 2013 Share Posted September 30, 2013 Here (Macro Reference) you can find a list of macros to replace the DOS macros (%SYSTEMROO% etc.) with. Run(@Systemdir & '\TAKEOWN.exe /f ' & @SystemDir & '"\Media\Windows Navigation Start.wav"' & ' /a') My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
MHz Posted September 30, 2013 Share Posted September 30, 2013 Here is quite a different way to do it. Environmental Variables will be expanded like in a command script. && runs the next command if the previous command was successful. Opt('ExpandEnvStrings', 1) RunWait('"%ComSpec%" /c ' & _ 'TAKEOWN.exe /f "%SystemRoot%\Media\Windows Navigation Start.wav" && ' & _ 'CACLS.exe "%SystemRoot%\Media\Windows Navigation Start.wav" /E /G Administrators:F && ' & _ 'DEL.exe /Q "%SystemRoot%\Media\Windows Navigation Start.wav"' _ , @SystemDir, @SW_HIDE _ ) Opt('ExpandEnvStrings', 0) For those who like CMD. I usually do like water shows though sometimes an exception makes me think of other ways. 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