Jump to content

How can I run with parameters


Recommended Posts

My regedit codes

RegWrite('HKLM\SOFTWARE\Classes\*\shell\HideFil', 'MUIVerb', 'REG_SZ','Hide file')
RegWrite('HKLM\SOFTWARE\Classes\*\shell\HideFil', 'Icon', 'REG_EXPAND_SZ', '%USERPROFILE%\Desktop\HiddenFileFolder\HiddenFileFolder.exe')
RegWrite('HKLM\SOFTWARE\Classes\*\shell\HideFil\command', '', 'REG_EXPAND_SZ', '"%USERPROFILE%\Desktop\HiddenFileFolder\HiddenFileFolder.exe" /+H')

RegWrite('HKLM\SOFTWARE\Classes\*\shell\ShowFil', 'MUIVerb', 'REG_SZ','Show File')
RegWrite('HKLM\SOFTWARE\Classes\*\shell\ShowFil', 'Icon', 'REG_EXPAND_SZ', '%USERPROFILE%\Desktop\HiddenFileFolder\HiddenFileFolder.exe')
RegWrite('HKLM\SOFTWARE\Classes\*\shell\ShowFil\command', '', 'REG_EXPAND_SZ', '"%USERPROFILE%\Desktop\HiddenFileFolder\HiddenFileFolder.exe" /-H')

And my others code

HiddenFileFolder.exe

If $Cmdline[0] <> 0 Then
        $attrib="+H"
        $aError=False
        For $i=1 To $Cmdline[0]
                If StringInStr(FileGetAttrib($Cmdline[$i]), "D") Then
                        If StringInStr(FileGetAttrib($Cmdline[$i]),"H") Then $attrib ="-H"
                        FileSetAttrib($Cmdline[$i], $attrib,1)
                        $aListFiles=_FileFolderList($Cmdline[$i])
                        If Not @error Then
                                For $t = 1 To $aListFiles[0][0]
                                        $returnattrib=FileSetAttrib($aListFiles[0][$t], $attrib)
                                        If Not $returnattrib Then $aError=True
                                Next
                        EndIf
                Else
                        If StringInStr(FileGetAttrib($Cmdline[$i]),"H") Then $attrib ="-H"
                        $returnattrib=FileSetAttrib($Cmdline[$i], $attrib)
                        If Not $returnattrib Then $aError=True
                EndIf
        Next
If $aError Then
        MsgBox(16, "Error!", "An error occurred while changing the properties of some files!")
Else
        MsgBox(64, "Successful!", "All the files have been successfully hidden!")
EndIf
EndIf

Func _FileFolderList($path)
Dim $return[2][1000000]
If StringRight($path,1) <> "\" Then $path &="\"
$search = FileFindFirstFile($path & "*")
If @error = 1 Then  SetError(2)
If Not StringInStr(FileGetAttrib ( $path), "D") Then Return SetError(1)

$afile = 0
$folder = 0
While 1
    $file = FileFindNextFile($search)
    If @error = 1 Then ExitLoop
        If @extended = 1 Then
                $folder += 1
                $return[1][$folder]=$path & $file

        Else
                $afile += 1
                $return[0][$afile]=$path & $file

        EndIf
WEnd
FileClose($search)
$return[1][0]=$folder
$return[0][0]=$afile
ReDim $return[2][_Max($folder, $afile)+1]
Return $return
EndFunc ;==>_FileFolderList
Func _Max($nNum1, $nNum2)
                If $nNum1 > $nNum2 Then
                Return $nNum1
        Else
                Return $nNum2
        EndIf
EndFunc   ;==>_Max

 

Edited by youtuber
Link to comment
Share on other sites

  • Developers

... and you are sure you couldn't find this on the internet with a simple Google search? ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...