Jump to content

Installing autosort.vbs?


Recommended Posts

Hi all

I have found a script on the MS oem site that is sorting up your desktop automaticley.

I already customised the script to my native language of MS xp pro.

But now I am stuck. Where do I put this script?

On the oem site they say

The following scripts can be included in your Windows® XP preinstall by including in a [GUIRunOnce]section of the Unattend.txt file or a [OEMRunOnce] section of the Winbom.ini file:

But this is magic to me. Is there any body out there who is able to help me?

Greats DaRKNeSS

PS; I have included the txt file i have saved witch will explain how to make the script so you can make one your self, I know I have search a long time to get my recycle bin out of its right corner. and now I am realy close :thumbup:thumbup

autosort_desktop_icons.txt

Link to comment
Share on other sites


I have re edit the script to this

Save as SortIcons.VBS

Dim Act, AppData, Fso,SD

Set Act = CreateObject("WScript.Shell")

Set Fso = CreateObject("Scripting.FileSystemObject")

SD = Act.ExpandEnvironmentStrings("%Systemdrive%")

''''' APPDATA IS NOW A VARIBLE FOR THE VBS SCRIPT

''''GERMAN LANGUAGE

''''JUST CUT AND PASTE THE GERMAN VERSION --> APPDATA & "\Microsoft\Internet Explorer\Quick Launch\Desktop anzeigen.scf

AppData = Act.ExpandEnvironmentStrings("%Appdata%")

AppData = AppData & "\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf"

'Minimize all open windows

Act.Run(Chr(34) & AppData & Chr(34))

WScript.Sleep 1000

'Refresh Desktop

Act.sendkeys "{F5}"

WScript.Sleep 500

''''' FOR GERMAN LANGUAGE OF WINDOWS

'''''Act.sendkeys "M"

'''''Act.sendkeys "A"

'Auto Sort Icons

Act.sendkeys "+{F10}"

Act.sendkeys "I"

Act.sendkeys "A"

'''' CLEAN UP THE VBS FILE IF IT EXISTS

'''' THIS IS WHERE IT WILL BE EXTRACTED FROM THE SFX FILE.

If Fso.FileExists(SD & "\SortIcons.vbs") Then

Fso.DeleteFile(SD & "\SortIcons.vbs")

End If

No all you have to do is add it to the RunOnceEx.cmd

Example Only

for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "The Install Section" /f

REG ADD %KEY%\000 /VE /D "Preparing Installation..." /f

REG ADD %KEY%\001 /VE /D "Sort Desktop Icons" /f

REG ADD %KEY%\001 /V 1 /D "%CDROM%Apps\SortIcon.vbs" /f

I have included a sfx file with the above script in it so the RunonceEx.cmd

should look like this

Example Only

for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "The Install Section" /f

REG ADD %KEY%\000 /VE /D "Preparing Installation..." /f

REG ADD %KEY%\001 /VE /D "Sort Desktop Icons" /f

REG ADD %KEY%\001 /V 1 /D "%CDROM%Apps\SortIcon.exe" /f

Edited by gunsmokingman
Link to comment
Share on other sites

gunsmokingman

Don't get me wrong I like that you are trying to help me. But I see you have edited the script for the german language, but I am from Holland :P

Are there some major error's in the script I made??

'Script to Auto Arrange Desktop Icons

Set WshShell = WScript.CreateObject("WScript.Shell")

'Minimize all open windows
WshShell.Run """C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Internet Explorer\Quick Launch\Bureaublad weergeven.scf""" WScript.Sleep 1000

'Refresh Desktop
WshShell.sendkeys "{F5}"
WScript.Sleep 500

'Auto Sort Icons
WshShell.sendkeys "+{F10}"
WshShell.sendkeys "S"
WshShell.sendkeys "h"

I like to try things my self, so I can learn from my misstakes and I now what I am doing with my own system.

If I am right this script does everytime an Auto sort of the icons I think I am going to change that in, that it is doing that just once. Gues I have to change the WshShell.sendkeys.

I am going to try to just put it in my RunOnceEx with this line

REG ADD %KEY%\001 /VE /D "Sort Desktop Icons" /f
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Install\Apps\SortIcon.vbs" /f

and try it that way. I thought I had to put some sort .vbs app in my I386 or something. I never guest that it would be that easy.

DaRKNeSS

Link to comment
Share on other sites

No I was using the text file that you posted. That was using C:\ I change that to a varible AppData,

this allows the drive to be either D:, E:\ etc plus I added a clean up part to the script.

I aslo notice that the sleep was at the end of the run command which on my machine

will not run like that.

Yours

WshShell.Run """C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Internet Explorer\Quick Launch\Bureaublad weergeven.scf""" WScript.Sleep 1000

Mine

AppData = Act.ExpandEnvironmentStrings("%Appdata%")

AppData = AppData & "\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf"

Act.Run(Chr(34) & AppData & Chr(34))

WScript.Sleep 1000

This part is the varible Appdata, this will always pass the drive and User name back to the script.

C:\Documents and Settings\%USERNAME%\Application Data
Link to comment
Share on other sites

I have got it!!!! :thumbup

Indeed if I ran the script I was getting an error (line6 Nmb 140). I have counted the symbol numbers. And it was the sleep comand.

Just one enter and it launced okee from whitin my RunOnceEx. I am working on some other Apps now if they are ready, I am going to burn (dvdrw) and going to test it for real.

I learned a lot this way Thanks for your help.

DaRKNeSS

Link to comment
Share on other sites

:realmad::realmad::realmad:

I didn't worked with my unatended install geting errors (somthing about line 6 sign 1)

But when I am running the script after my setup is finished no problems.

I it possible that I must run the script before I install zonealarm?

I will try this anyway wish me luck. :}

DaRKNeSS

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...