| 1. |
Solve : change my wallpaper each time i login? |
|
Answer» Hello, what about if i wanted to do it in DOS First you would need a machine with DOS installed. Why do you want to use batch code anyway on a WinXP machine? Code: [Select]@echo off set source="source directory goes here" set dest="destination directory goes here" for /f "tokens=* delims=" %%i in ('dir /ta /b /o:d %source%') do ( echo y | copy "%source%\%%i" "%dest%" > nul echo Y | copy /b "%dest%\%%i" "%source%" > nul echo y | reg add "HKCU\Control Panel\Desktop" /v Wallpaper /d "%dest%\%%i" > nul goto :eof ) Be sure to change source and dest to valid directory names otherwise its the same stuff as yesterday: The script will select a picture each time it is run and update the registry. If you have a shutdown script, I would put it in there so the wallpaper resets at the next boot. If you put it in the startup folder, the wallpaper change may not take effect until you logoff/logon. You may have to play around with this. hello, Im a former Cobol programmer, so im learning as i go .....so I dont have VB to develop in but I do know a little about dos...not much as you can see if there is a way to develop in VB without having to pay for it ....i could do that ?? I tried the dos script but it gave me this Source = "C:\path\input" Dest = "C:\path\output" copy ""C:\path\input"\pic1.jpg" ""C:\path\output"" and the copy didnt work thanks for your help cheers Check out Microsofts Express range http://www.microsoft.com/express/Windows/ GrahamQuote from: newkid on July 23, 2010, 04:56:36 AM Im a former Cobol programmer You might like COBOL.NET I guess I got a little carried away with the quotes. Code: [Select]@echo off set source=source directory goes here set dest=destination directory goes here for /f "tokens=* delims=" %%i in ('dir /a:-d /ta /b /o:d "%source%"') do ( echo y | copy "%source%\%%i" "%dest%" > nul echo Y | copy /b "%dest%\%%i" "%source%" > nul echo y | reg add "HKCU\Control Panel\Desktop" /v Wallpaper /d "%dest%\%%i" > nul goto :eof ) Do not quote the source or dest values at the beginning of the code even if the PATHS have embedded spaces. They will be inserted at the proper time. For the record, the first script I posted was VBScript which was installed on your system with Windows. All you need now is a DOLLAR and a dream. There is a compiled help file for VBScript (script56.chm) which you can search for on your machine or you can download it from here Except for REXX, IMO VBScript is one of the easiest script languages to learn and has much more functionality than batch code could ever hope to have. Good luck. It WORKS ...thanks very much !! Hello, As I looked for the same (i.e. a small script or tool to change the Windows wallpaper in a random way every day - and without downloading an .exe file...), I tried the VB script available at the URL: http://sites.google.com/site/sharerandomwallpapers/ It works fine and handles a variable number of files (the VB script listed above only handles 3 files or a constant number of files...). I hope it will bring some help! John |
|