noobish Posted December 9, 2012 Posted December 9, 2012 There is another issue i have my firends.In this script made by user JLogan3013 i want to make it an install of an image where the script it is so a user to be able to execute the script/exe and instal a wallpaper. But when i use the fileinstall function i get a syntax error. [autoit FileInstall(@ScriptDir "\ss.bmp", @ScriptDir "\ss.bmp') $oShell = ObjCreate("WScript.Shell") $oFSO = ObjCreate("Scripting.FileSystemObject") $Wallpaper = @ScriptDir & "\ss.bmp" $oShell.RegWrite("HKCU\Control Panel\Desktop\Wallpaper", $WallPaper) $oShell.RegWrite("HKCU\Control Panel\Desktop\WallpaperStyle", "2") $oShell.Run("%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True)[/autoit] Any ideas, Thank you .
JohnOne Posted December 9, 2012 Posted December 9, 2012 "This must be a literal string; it cannot be a variable or the result of a function call" That is in bold in the help file for that paramater. basic rule while finding your scripting feet, is to open the helpfile on every function you are using and read it as you go along several times. you know it makes sense. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JohnOne Posted December 9, 2012 Posted December 9, 2012 oh and.FileInstall(@ScriptDir & "ss.bmp", @ScriptDir & "ss.bmp')is the actual syntax error AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
noobish Posted December 9, 2012 Author Posted December 9, 2012 Thank you johhOne, But it throws ths error again. : ERROR: syntax error (illegal character) FileInstall(@ScriptDir & "ss.bmp", @ScriptDir & " the whole script FileInstall(@ScriptDir & "ss.bmp", @ScriptDir & "ss.bmp') $oShell = ObjCreate("WScript.Shell") $oFSO = ObjCreate("Scripting.FileSystemObject") $Wallpaper = @ScriptDir & "ss.bmp" $oShell.RegWrite("HKCUControl PanelDesktopWallpaper", $WallPaper) $oShell.RegWrite("HKCUControl PanelDesktopWallpaperStyle", "2") $oShell.Run("%windir%System32RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True) Thank you once again.
JohnOne Posted December 9, 2012 Posted December 9, 2012 What happens when you replace the source param with a "literal string" as mentioned in post 2? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
noobish Posted December 9, 2012 Author Posted December 9, 2012 I am sorry man i am annoying and....but what we call a literal string ?
JohnOne Posted December 9, 2012 Posted December 9, 2012 (edited) "This is a literal string" $ThisIsAVariable. @ThisIsAMacroVariable. EDIT: Did you know there are examples of how to use each function, in the help file? At the bottom they are. Both source and destination are literal strings in FileInstall example. But only the source need to be. 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.
noobish Posted December 9, 2012 Author Posted December 9, 2012 Thank you for the lesson,now i have no errors,but the script it doesn't install the .bmp image. here is the script FileInstall("C:ss.bmp", "@ScriptDir ss.bmp") $oShell = ObjCreate("WScript.Shell") $oFSO = ObjCreate("Scripting.FileSystemObject") $Wallpaper = @ScriptDir & "ss.bmp" $oShell.RegWrite("HKCUControl PanelDesktopWallpaper", $WallPaper) $oShell.RegWrite("HKCUControl PanelDesktopWallpaperStyle", "2") $oShell.Run("%windir%System32RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True) I dont like bother you guys and allready you have helped me very very much ,but i just want a compiled .exe which when a user executes to install a .bmp image which later the same script will install the same .bmp image as wallpaper.
Developers Jos Posted December 9, 2012 Developers Posted December 9, 2012 Shouldn't that be: FileInstall("C:ss.bmp", @ScriptDir & "ss.bmp") 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.
noobish Posted December 9, 2012 Author Posted December 9, 2012 You know something guys, you all rock inside here,i know this is easy stuff for you but the help you give is awesome . I have no words this is it, thank you Jos , You should kick my ass now but i will make another question, does this script will work on x64 machines. And how to make that script to use and a .png image also. I am extremely obligated to all of you.
noobish Posted December 9, 2012 Author Posted December 9, 2012 I shouldn't bump this, but just wanted to ask how to make this script use a .png or .jpeg image. This one works only with .bmp image. $oShell = ObjCreate("WScript.Shell") $oFSO = ObjCreate("Scripting.FileSystemObject") $Wallpaper = @ScriptDir & "ss.bmp" $oShell.RegWrite("HKCUControl PanelDesktopWallpaper", $WallPaper) $oShell.RegWrite("HKCUControl PanelDesktopWallpaperStyle", "2") $oShell.Run("%windir%System32RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True)
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