Jump to content
svenjatzu

Autorun File on Paste to the Desktop - (Moved)

Recommended Posts

Hey,

im looking for a way to execute files automatically when i copy them do the desktop.

Someone knows how this can be solved?

I thought about creating an .exe with winrar and adding an .ini file to the archive to my autoit.exe so that it could run like an autorun.ini on usb sticks but i guess this wont work.

 

Hope someone got an idea : )

Share this post


Link to post
Share on other sites

Moved to the appropriate forum.

Moderation Team


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Posted (edited)

 Not an auto-run example but perhaps a head start idea to incorporate ..

#include <File.au3>

Global $sd = ObjCreate("Scripting.Dictionary"), $array = _FileListToArrayRec(@DesktopDir, "*")  ; array snapshot the list of files in the desktop folder
For $i = 1 To UBound($array) - 1
    $sd.Item($array[$i]) = 1
Next

HotKeySet("{ESC}", "Terminate")  ; Exit
HotKeySet("^e", "Run_Display")     ; ctrl + e

While 1
    Sleep(2000)
WEnd

Func Run_Display()
    Local $a = _FileListToArrayRec(@DesktopDir, "*"), $sdTmp = ObjCreate("Scripting.Dictionary")
    For $i = 1 To UBound($a) - 1
        If $sd.Exists($a[$i]) Then ContinueLoop
        ;add any new files to $sdTmp array
        $sdTmp.Item($a[$i]) = @DesktopDir & "\" & $a[$i]
    Next
    $array = $a         ; update main snapshot
    $a = $sdTmp.Items
    _ArrayDisplay($a)     ; process new files ..
EndFunc   ;==>Run_Display

Func Terminate()
    Exit
EndFunc   ;==>Terminate

Deye

Edited by Deye
typo

Share this post


Link to post
Share on other sites

Thanks : )

But im not shure if thats what im looking for.

what i need is that the file autmatically executes when i paste it to another folder.

Just like i copy it from my pc and past it to another pc, in the moment when its copied to the other pc it should execute without that i need to run it on my own

Share this post


Link to post
Share on other sites

svenjatzu,

its possible to make it work but its really up to you make it,

Maybe simpler to walk the process through starting with FileOpenDialog() ..

if you already have any code for this and still cant make it work then post it here to get more help

Deye

Share this post


Link to post
Share on other sites

Hey Deye, thanks for your replay,

my code is verry simple,

#include <MsgBoxConstants.au3>

Local $sFilePath1 = RegRead("HKEY_CURRENT_USER\Software\JavaSoft\Prefs\elo\clients\hardware", "Code")
Local $sFilePath = RegRead("HKEY_CURRENT_USER\Software\JavaSoft\Prefs\elo\clients\hardware", "Ticket")
MsgBox($MB_SYSTEMMODAL, "", "Der letzte Wettschein lautet: " & $sFilePath & " $ " & $sFilePath1)

Share this post


Link to post
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

×
×
  • Create New...