ninhgiangbs Posted September 29, 2013 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)
water Posted September 29, 2013 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
ninhgiangbs Posted September 29, 2013 Author Posted September 29, 2013 Thank you, I have tried and failed, it requires the use of 3 command /1 CMD
water Posted September 29, 2013 Posted September 29, 2013 Can you post what you have tried so far? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
ninhgiangbs Posted September 29, 2013 Author 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"')
water Posted September 30, 2013 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
MHz Posted September 30, 2013 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.
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