i want a script for AHK v2 that is searching for a file in all drives named “autorun.inf” that contains the line “label=jhon” and if the script found the file to search only in the same drive for a file named “userData.txt” that contains the line “id=11111” and the line “stickerId=2222”
if the script found the two files in the same drive to run cmd. and if not to show a message “it’s not youre program”
thanks
i asked chatbot ai he gave me this script but its not working
#Requires AutoHotkey v2.0
DriveGet Drives List
for index Drive in Drives {
autorunPath := drive . "autrun.inf"
if FileExist(autorunPath) {
FileRead autorunContent %autoPath%
if InSrt(autorunContent, "[autorun]") && InStr(autorunContent, "label=jhon") {
userDataPath := drive . "userData.txt"
if FileExist(userDataPath) {
FileRead userDataContent %userDataPath%
if InStr(userDataContent, "clientId=38412") && InStr(userDataContent, "stickerId=28270") {
Run "cmd.exe"
}
Else MsgBox 'it's not youre program', 'message', 'Icon!'
}
}
}
}
the program just dosent work, It shows me a lot of errors
sorry for my bad english
חיים אשכנזי is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.