my pet project to create an app to run portable software it works and has a few other features
Code:
#SingleInstance
gui01 = 0
gui02 = 0
DetectHiddenWindows, On
SplitPath, A_WorkingDir ,,,,, DriveLet
IniRead, Direc, apps.ini, wall, dir, \wallpaper
ifexist %DriveLet%%Direc%
{
ArrayCount = -1
loop %DriveLet%%Direc%\*.bmp, 0, 0
{
ArrayCount += 1
Array%ArrayCount% := A_LoopFileFullPath
}
Random, z , 0, %ArrayCount%
element := Array%z%
DllCall("SystemParametersInfo", UInt, 0x14, UInt, 0, Str, element, UInt, 2)
}
Loop, Read, autorun.lst
run %A_LoopReadLine%
DriveSpaceFree, freespace, %DriveLet%
DriveGet, cap, capacity, %drivelet%
Gui, Add, Edit, x66 y60 w260 h20 Vappto, edit
Gui, Add, Text, x6 y10 w320 h30 , Type the name of a program`, folder`, document`, or Internet resource`, and RUS will open it for you.
Gui, Add, Text, x10 y62 w36 h16 , &Open:
Gui, Add, Button, x96 y130 w70 h23 gRun Default, OK
Gui, Add, Button, x176 y130 w70 h23 gCancel, Cancel
Gui, Add, Button, x256 y130 w70 h23 gShort, Short
Gui, Add, Picture, x336 y10 w157 h157, %A_WorkingDir%\RUS.PNG
Gui, Add, Text, x171 y90 w70 h20 , Free Space:
Gui, Add, Text, x241 y90 w90 h20 , %freespace% / %cap% MB
Gui, Add, Progress, x166 y110 w160 h10 Range0-%cap% BackgroundRed cGreen, %freespace%
Gui, 2:Add, ListBox,vMyListBox gMyListBox x16 y30 w120 h320 Sort +\, MyListBox
Gui, 2:Add, Edit, vApppath x146 y40 w310 h20 ,
Gui, 2:Add, Text, x16 y10 w120 h20 , Apps Found On Drive:
Gui, 2:Add, Text, x146 y10 w310 h20 , Relitive Path To Selected App:
Gui, 2:Add, Text, x146 y70 w310 h20 , Your Short:
Gui, 2:Add, Edit, vShort x146 y100 w310 h20 , short
Gui, 2:Add, Text, x146 y140 w310 h180 , Guide It May take Some Time To Refresh The APP PATH FIELD
Gui, 2:Add, Button, gShort2 x356 y330 w100 h20 , short
Gui, 2:Add, Button, x236 y330 w100 h20 gAutoRun, AutoRun
loop \*.exe, 1, 1
GuiControl,2:, MyListBox, %A_LoopFileName%
#e::
{
if gui02 = 0
{
Gui, 2:Show,, Really Useful Stuff Short Cut Editor
gui02 = 1
}
else
{
Gui, 2:hide
gui02 = 0
}
}
Return
#r::
{
if gui01 = 0
{
GuiControl, Text, appto,
GuiControl, Focus, appto
Gui, Show,, Really Useful Stuff
gui01 = 1
}
else
{
Gui, hide
gui01 = 0
}
}
return
#t::
if not DllCall("IsWindowVisible", "Uint", WinExist("ahk_class Progman"))
{
WinShow
}
else
{
WinHide
}
return
#c::
{
Random, z , 0, %ArrayCount%
element := Array%z%
DllCall("SystemParametersInfo", UInt, 0x14, UInt, 0, Str, element, UInt, 2)
}
return
Short:
GuiControlGet, appto,
inputBox short,What Short Cut Do You Wish To Asign?,,,,100,,,,,
IniWrite, %Appto%, apps.ini, apps, %short%
Gui, hide
gui01 = 0
return
Run:
GuiControlGet, appto,
IniRead, path, apps.ini, apps, %Appto%
run %path%,, UseErrorLevel
if errorlevel = ERROR
Run, %Appto%,, UseErrorLevel
Gui, hide
gui01 = 0
return
Cancel:
Gui, hide
gui01 = 0
GuiClose:
Gui, hide
gui01 = 0
return
MyListBox:
if A_GuiEvent <> DoubleClick
GuiControlGet, MyListBox, 2:
loop \%MyListBox%, 1, 1
GuiControl, 2:Text, Apppath, %A_LoopFileFullPath%
return
return
short2:
GuiControlGet, Apppath, 2:
GuiControlGet, Short, 2:
IniWrite, %Apppath%, apps.ini, apps, %short%
return
AutoRun:
GuiControlGet, Apppath, 2:
FileAppend,
(
%Apppath%
), autorun.lst
return
2GuiClose:
Gui, 2:hide
gui02 = 0
return
the apps .ini file
Code:
[apps]
[wall]
dir=\
and the not so good read me!
REALLY USEFUL STUFF
----- | | /-----/
| | | | |
| | | | |
----- | | \-----\
| \ | | |
| \ | | |
| \ \-----/ /-----/
V0.7 (+ a bit)
-----------------------
I. INFO
Really Useful Stuff is hopefully what it says on
the tin... useful it is an application that offers
a quick way to run you applications on your PC or
USB using simple customisible command that can be as
long or as short as you want.
It is fully portable and uses relitive paths for apps
can accept command lines for apps to run and best of
all the source code is included... There IS NO WARRANTY
i can accept no responsiblity for any damage this app may
cause you can do with the source code as you please as long
as you inform me and give me a copy of your altered code if you
intend to publish it. i am a bit nosie and like to see how
my code has been used ^_^
-----------------------
II.
HotKeys For Main Features
WindowsKey
+ E
Displays RUS Short Cut And Auto RUN creator
this is a simple part of the program that
allows you to create a short cut for one
of the exe's at the side or any folder or
website you like
Exe's displayed in the list pane are those
located on the drive RUS is.
All Paths Are Relive
R
Displays The Runsection of the application
this is pretty much self explanitory
T
Hide's Desktop Icons ON/OFF
mainly used to show your own background on
certain PC's where they wont display ... HA
C
Randomly changes the wallpaper of your pc
wallpaper directory place in apps.ini where dir=\
path must be relive and contain bmps
end of read me so far
lol
png that needs to go in the director is my avatar name it rus.png
hope fully show off a few neat features of ahk[/img]