noobish Posted December 8, 2012 Share Posted December 8, 2012 I am pain in the a$$ i know it , but this script i'm not able to make it work, i want just a script compiled to exe, and when i executed to install a wallpaper. $Wallpaper = "...\blabla.jpg" ; for example $Stile = "Fit" ; yeah .. fit should say enough Select Case $Stile="Center" $Stile="0" $Stile2="0" Case $Stile="Fit" $Stile="1" $Stile2="0" Case $Stile="Stretch" $Stile="2" $Stile2="0" Case $Stile="Fill" $Stile="-1" $Stile2="0" Case $Stile="Tile" $Stile="0" $Stile2="1" EndSelect RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", $Stile) RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallpaper", "REG_SZ", $Stile2) DllCall("user32.dll", "int", "SystemParametersInfo","uint",20,"uint",0,"str",$Wallpaper,"uint",3) Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 9, 2012 Moderators Share Posted December 9, 2012 Something like this should get you started: $oShell = ObjCreate("WScript.Shell") $oFSO = ObjCreate("Scripting.FileSystemObject") $Wallpaper = @DesktopDir & "1.bmp" $oShell.RegWrite("HKCUControl PanelDesktopWallpaper", $WallPaper) $oShell.RegWrite("HKCUControl PanelDesktopWallpaperStyle", "2") $oShell.Run("%windir%System32RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True) "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
noobish Posted December 9, 2012 Author Share Posted December 9, 2012 JLogan3o13 thank you for your help,i put a random .bmp image in my script dir, i compile it to an .exe, but when i executed nothing happens. I don't know why. Link to comment Share on other sites More sharing options...
JohnOne Posted December 9, 2012 Share Posted December 9, 2012 (edited) Is there anything about this which would make you think it meant script dir? "@DesktopDir" Edited December 9, 2012 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 9, 2012 Moderators Share Posted December 9, 2012 Did you change the path to the file from @DesktopDir to @ScrtipDir? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
noobish Posted December 9, 2012 Author Share Posted December 9, 2012 (edited) My mistake people sorry,which one is the @DesktopDirEDIT*Sorry people i'm tatally burned,i found the problem,is in my headThank you all, God bless you allEverything works great, i appreciate your assistance, you are just great Edited December 9, 2012 by noobish Link to comment Share on other sites More sharing options...
noobish Posted December 9, 2012 Author Share Posted December 9, 2012 hmm,sorry i'm back,how to do this script to use a jpeg or png image. Link to comment Share on other sites More sharing options...
Chimaera Posted December 9, 2012 Share Posted December 9, 2012 If you had a look this would crop up If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
noobish Posted December 9, 2012 Author Share Posted December 9, 2012 Thank you very much guys that does the trick. Ah,i must built separate exe for x86 and x64 isn't it if i want this script to work to both ? Thank you all. Link to comment Share on other sites More sharing options...
guinness Posted December 9, 2012 Share Posted December 9, 2012 No, look at RegRead in the help file on how to write to the 64-bit registry values. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
FreeBeing Posted September 13, 2013 Share Posted September 13, 2013 hmm,sorry i'm back,how to do this script to use a jpeg or png image. If it can help you, I found a PowerShell script that call the user32.dll to do that, and I converted it into an AutoIt script, example : $wallpaper = "C:\Windows\Web\Wallpaper\Nature\Natural-scenery-of-the-Canadian-forest-lake_1920x1200.jpg" DllCall("user32.dll", "int", "SystemParametersInfo","int",20,"int",0,"str",$wallpaper,"int",0x01) With that code, a simple JPG wallpaper can be set, without rebooting computer. Link to comment Share on other sites More sharing options...
TheSaint Posted September 13, 2013 Share Posted September 13, 2013 (edited) If it can help you, I found a PowerShell script that call the user32.dll to do that, and I converted it into an AutoIt script, example : $wallpaper = "C:\Windows\Web\Wallpaper\Nature\Natural-scenery-of-the-Canadian-forest-lake_1920x1200.jpg" DllCall("user32.dll", "int", "SystemParametersInfo","int",20,"int",0,"str",$wallpaper,"int",0x01) With that code, a simple JPG wallpaper can be set, without rebooting computer. Mmmm, thanks for sharing that. I don't recall anyone here ever coming across that before and posting about it? Hopefully it works for XP. There are many wallpaper programs here, most of which use third party stuff, but a few used a DLL call for bmp (only). Looks like I have a program of mine to update a little now, which may well be easier than how I was gonna do it. P.S. My program uses the DLL call, but IrfanView command-line for jpegs. EDIT Now that I've said that, people are sure to find plenty of instances I missed. Edited September 13, 2013 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
guinness Posted September 13, 2013 Share Posted September 13, 2013 Mmmm, thanks for sharing that.I don't recall anyone here ever coming across that before and posting about it?It's been documented in the Example section already. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
FreeBeing Posted September 13, 2013 Share Posted September 13, 2013 (edited) Mmmm, thanks for sharing that. I don't recall anyone here ever coming across that before and posting about it? Hopefully it works for XP. In fact, it works only with Vista, 7, 8 and 8.1 Edited September 13, 2013 by FreeBeing Link to comment Share on other sites More sharing options...
TheSaint Posted September 13, 2013 Share Posted September 13, 2013 (edited) It's been documented in the Example section already. That figures, and it's not like I've been actively looking for a solution, just occasionally keep tabs on what catches my eye there, so not really surprising I missed it ... or if it was a while back, and non XP was mentioned then I may have just not retained it. In fact, it works only with Vista, 7, 8 and 8.1 Damn, I should have known it was too good to be true, and checked back here sooner. Now I've pulled my program (SetAs Wallpaper) out of storage for nothing ... maybe. I don't even have it installed on my Laptop (XP) or Netbook (Win7). Last time I updated the program, was back in September 2009, when my Main Desktop was still working, and it was used to great effect there. It's odd to think, that I've stayed with the same boring Crystal.jpg background on my Laptop for years now (never meant to be my main PC replacement, but using it with it's keyboard, mouse and monitor now). On my Desktop, the background changed every second day and more often if a Birthday was set. Haven't needed a program on the Netbook, as the program I used to overcome the Starter Edition restriction also changes the background every day for me. My old Desktop still runs my program, but I don't use it that much ... mainly just for burning and ripping. Oh well, perhaps I'll look into my original intention (GDIPlus .... jpg to bmp on the fly ... if I remember rightly). Edited September 13, 2013 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
TheSaint Posted September 13, 2013 Share Posted September 13, 2013 DllCall("user32.dll", "int", "SystemParametersInfo","int",20,"int",0,"str",$wallpaper,"int",0x01) Actually, now that I've checked my code, that's the same DllCall as I'm using for bmp, except my last parameter is 0 not 0x01 So I guess it just works differently after XP, and I knew after all. Funny how often I find myself working on a program update, where it's the same month, but different year to last one. In this case, September four years ago. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
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