mounir Posted March 17, 2014 Posted March 17, 2014 Hi every one!In my automatic installation, i will to setting the small Icon of the desktop!--> I try the first solution : have 3 files File name : RunVBS.VBSSet WshShell = CreateObject("Wscript.Shell")Set ofs = CreateObject("Scripting.FileSystemObject")strScriptDir = ofs.GetParentFolderName(Wscript.ScriptFullName)strFile = strScriptDir & "\SmallIcon.vbs"WshShell.Run "C:\Windows\System32\cscript.exe " & Chr(34) & strFile & Chr(34)wscript.sleep 2000strFilea = strScriptDir & "\ReStartExploreWin.vbs"WshShell.Run "C:\Windows\System32\cscript.exe " & Chr(34) & strFilea & Chr(34)File name : SmallIcon.VBS'Petite taille : valeur décimal : 32 - valeur Héxadécimal : 20'Moyenne taille : valeur décimal : 48 - valeur Héxadécimal : 30'Grande taille : valeur décimal : 96 - valeur Héxadécimal : 60'-- Il faut kill explorer puis le relancer!Option ExplicitDim objShell, strRoot, strRoot1, strModify, strDeletestrRoot = "HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags\1\Desktop\IconSize"strRoot1 = "HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\Shell Icon Size"' Create the Shell objectSet objShell = CreateObject("WScript.Shell")strModify = objShell.RegWrite(strRoot,"00000032", "REG_DWORD")'WScript.Echo "Error No: " & err.number & " check " & strRootstrModify = nullstrModify = objShell.RegWrite(strRoot1,"32", "REG_SZ")'WScript.Echo "Error No: " & err.number & " check " & strRoot1strModify = nullWScript.Quit' End of .RegWrite example script.File name : ReStartExploreWin.vbsOn Error Resume Next' Kill Explorer.exestrComputer = "."Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'explorer.exe'")For Each objProcess in colProcessList objProcess.Terminate(1)Next' Launch Explorer.exeSet objShell = CreateObject("Wscript.Shell") objShell.Run "explorer.exe" Set objShell = NothingWscript.exit--> I try the second solution : have 3 files File name : REG_RUN.VBSwscript.exe "c:\vbs\smallicondesktop\invisible.vbs" "c:\vbs\smallicondesktop\iconbur.bat"File name : Invisible.VBSCreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, FalseFile name : IconBur.Bat@echo off taskkill /im explorer.exe /f reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags\1\Desktop" /v IconSize /t REG_DWORD /d 00000032 /f "%windir%\explorer.exe"With the two solution not work when the automatique installation finish!I have only windows CLI open!But when i use it, it work fine!I try solution with SetupComplete.CMD, it not work to!I think we should wait for the full automatic configuration of the office to start my three files. would anyone please an idea or solution. thank you in advance
Tripredacus Posted March 17, 2014 Posted March 17, 2014 Try putting your script in FirstLogonCommands instead.
mounir Posted March 17, 2014 Author Posted March 17, 2014 sur! the two pack of the script i start from Microsoft-Windows-Shell-Setup | FirstLogonCommandsand the tirth test is the file SetupComplete.CMD!not work in this way!thank you in advance for your suggestion
mounir Posted March 17, 2014 Author Posted March 17, 2014 that is writing the launch of the VBS file is just in AutoUnattend.xml? <settings pass="oobeSystem">... <SynchronousCommand wcm:action="add"> <Description>IconSize Desktop</Description> <CommandLine>cmd /k start "" /wait cscript %SystemDrive%\VBS\SmallIconDeskTop\script1.vbs</CommandLine> <Order>2</Order> </SynchronousCommand>...</settings> thank you in advance for your answwer
Tripredacus Posted March 18, 2014 Posted March 18, 2014 I would use 1 .cmd file and put all your code in it. You can even send output to a file using > operator to see which specific commands are failing. Then reference your .cmd in the FirstLogonCommands. I presume your scripts work find if you run them manually? For reference, you may be running into a permissions or Session 0 issue. FirstLogonCommands executes as the logon user (Session 1) Setupcomplete.cmd executes as the LOCAL SYSTEM (Session 0)
mounir Posted March 18, 2014 Author Posted March 18, 2014 thank you for oyur answer!please, can you give more information because is new for me!you mean, i must put my code vbs or link runing my vbs file into file cmdand make the runing file cmd in the commande FirstLogonCommands of specialize section?what is the permission please!thank you in advance of your answer!
Tripredacus Posted March 18, 2014 Posted March 18, 2014 FirstLogonCommands is in the oobeSystem pass. Put all your commands into a .cmd and then have this in your XML: <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <Description>Run vbs from cmd</Description> <CommandLine>cmd /C start /wait c:\path\FirstLog.cmd</CommandLine> </SynchronousCommand> </FirstLogonCommands>I don't use VBS myself because of security messages. Example of how to put VBS into CMD:cscript c:\path\RunVBS.VBSOr use wscript if you want.
mounir Posted March 30, 2014 Author Posted March 30, 2014 It must go through the "Task Scheduler" as the setting of "Small Icons Office" can be performed only after the "Preparing Desktop" final Windows installation process.!OK 4 - AutoUnattend.XML WAIK UAC_DesktopIconSmall.pdf
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now