Getting a Batch File to run a VBScript
Posted: Thu Dec 02, 2004 10:54 pm
'Allo all!
Arbitar is here with a problem, and since you all are a smart punch of people, I thought you might be able to help.
Ok, best start wtih why I'm trying to do what I'm trying to do.
Short Version: Becasue I want to.
Long Version: Ok. My school is very ... tech based. It has lots of comptuers, and I spend half my day (2 periods) infront of comptuers. Well, they have plenty of restrictions, and I dont might that, except for one. They block access to the display control panel from some reasons, so you cant change the desktop. But I found a need to becasue the desktop by default it a ugly shade of GREEN with the school logo and XP logo. Ew. So I quickly found that if you replace a file in my user folder with a 1024x768 bmp names "Wallpaper1.bmp", it will change the wallpaper to that. SO on my desktop I set up a shortcut, and whenever I log in, I drag "Wallpaper1.bmp" to the folder, and refresh the desktop to get my background.
After a while though, that started feeling like too much work. So I set out to automate the procedure. So far its been good and I'm able to toally automate it. Except for one part.
I created a batch file (as previously stated) that automatically copies Wallpaper1.bmp on my desktop, to the correct folder, overwriting it if it already exists. Then I just need to refresh the desktop. I wrote a small vbscript (also previously stated >_<) to do this, and it works fine when I normally double click on it. Well, I need it to be totally automated, as previously stated, and so .. I set out to execute that special refresh.vbs from my batch file (automated commandline, in essence ^_^). Well, I sucsessfully had the batch file copy "Wallpaper1.bmp" to "C:\Documents and Settings\(username contains my name, ommited)\Application Data\Microsoft", and then had it navigate to the Other folder, where my vbs was, and had it try to execute my refresh.vbs. BZZZZ problem time.
It would work. It wouldnt execute and refresh. I tried the command, plain, "refresh.vbs", and i tried "call wscript refresh.vbs" and "call cscript refresh.vbs" and desperatly "call refresh.vbs".
Any ideas on how to execute my refresh.vbs from Set Background.bat?
Any help will be appreciated. Thanks ^_^ I'm rather stumped.
Arbitar is here with a problem, and since you all are a smart punch of people, I thought you might be able to help.
Ok, best start wtih why I'm trying to do what I'm trying to do.
Short Version: Becasue I want to.
Long Version: Ok. My school is very ... tech based. It has lots of comptuers, and I spend half my day (2 periods) infront of comptuers. Well, they have plenty of restrictions, and I dont might that, except for one. They block access to the display control panel from some reasons, so you cant change the desktop. But I found a need to becasue the desktop by default it a ugly shade of GREEN with the school logo and XP logo. Ew. So I quickly found that if you replace a file in my user folder with a 1024x768 bmp names "Wallpaper1.bmp", it will change the wallpaper to that. SO on my desktop I set up a shortcut, and whenever I log in, I drag "Wallpaper1.bmp" to the folder, and refresh the desktop to get my background.
After a while though, that started feeling like too much work. So I set out to automate the procedure. So far its been good and I'm able to toally automate it. Except for one part.
I created a batch file (as previously stated) that automatically copies Wallpaper1.bmp on my desktop, to the correct folder, overwriting it if it already exists. Then I just need to refresh the desktop. I wrote a small vbscript (also previously stated >_<) to do this, and it works fine when I normally double click on it. Well, I need it to be totally automated, as previously stated, and so .. I set out to execute that special refresh.vbs from my batch file (automated commandline, in essence ^_^). Well, I sucsessfully had the batch file copy "Wallpaper1.bmp" to "C:\Documents and Settings\(username contains my name, ommited)\Application Data\Microsoft", and then had it navigate to the Other folder, where my vbs was, and had it try to execute my refresh.vbs. BZZZZ problem time.
It would work. It wouldnt execute and refresh. I tried the command, plain, "refresh.vbs", and i tried "call wscript refresh.vbs" and "call cscript refresh.vbs" and desperatly "call refresh.vbs".
Any ideas on how to execute my refresh.vbs from Set Background.bat?
Any help will be appreciated. Thanks ^_^ I'm rather stumped.