mounir
MemberContent Type
Profiles
Forums
Events
Everything posted by mounir
-
automatically generates a frame
mounir replied to mounir's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
i use version 3.7 thank you in advance -
hi everyone, on this code which automatically generates a frame with encapsulated labels, I would like to generate a maximum of 4 frames. Until then, it works. The problem is that the variable i (number of frames) is not updated when one of the frames is deleted. The variable r is the one I have to retrieve to update the value i. I tried with return and callback without success. try: from Tkinter import * except: from tkinter import * from tkinter import messagebox # Librairie des fenêtres d'alerte def removeLabel(var): global frames global i z = -1 for frame in frames: z = z + 1 # Check the text variable of the label of this frame if frame.winfo_children()[4].var == var: # 4 est le nombre de labels à générer dans une frame # Supprime frame frame.destroy() # Mise à jour du nombre de frame frames = frames[:z] + frames[z+1:] z = -1 # Mise à jour du nombre de frame r = 0 for frame in frames: frame.winfo_children()[4].var.set(r) r = r + 1 i = i - 1 print("i", i) def addNewLabel(): global frames, i global table var = IntVar() frame = Frame(root) i = i + 1 if i <= 5: frame.grid(row=i, column=4) var.set(len(frames)) l = Label(frame, text="test") l.grid(row=0, column=0) l = Label(frame, textvariable=var) l.grid(row=0, column=1) l = Label(frame, textvariable=var) l.grid(row=0, column=2) l = Label(frame, textvariable=var) l.grid(row=0, column=3) l = Label(frame, textvariable=var) l.grid(row=0, column=4) l.var = var b = Button(frame, text="Remove", command=lambda: removeLabel(var)) b.grid(row=0, column=5) frames.append(frame) # liste des frames générée print("var.get() ", var.get(), " i ",i) # var.trace("w", lambda name, index, mode, i=i: removeLabel(i)) # print("eeeee", i) if i > 5: # Limite du nombre de 10 frames à générer messagebox.showinfo("Info","Seulement 10 huiles peuvent être sélectionées") c.configure(state=DISABLED) return "break" print("+i+",i) if __name__ == '__main__': root = Tk() frames = [] table = [] ind = [] ind1 = [] i = 1 c = Button(root, text="add label", command=addNewLabel) c.grid(column=0, row=0) root.mainloop()
-
SmallIcon Desktop with AutoUnattented
mounir replied to mounir's topic in Unattended Windows 7/Server 2008R2
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 -
SmallIcon Desktop with AutoUnattented
mounir replied to mounir's topic in Unattended Windows 7/Server 2008R2
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 cmd and make the runing file cmd in the commande FirstLogonCommands of specialize section? what is the permission please! thank you in advance of your answer! -
SmallIcon Desktop with AutoUnattented
mounir replied to mounir's topic in Unattended Windows 7/Server 2008R2
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 -
SmallIcon Desktop with AutoUnattented
mounir replied to mounir's topic in Unattended Windows 7/Server 2008R2
sur! the two pack of the script i start from Microsoft-Windows-Shell-Setup | FirstLogonCommands and the tirth test is the file SetupComplete.CMD! not work in this way! thank you in advance for your suggestion -
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.VBS Set 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.vbs On 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.VBS wscript.exe "c:\vbs\smallicondesktop\invisible.vbs" "c:\vbs\smallicondesktop\iconbur.bat"File name : Invisible.VBS CreateObject("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
-
thank you for your answer! Why is limited and where can find information about that? have some script available for up this limited context menu items? a+
-
Hi every on! On Windows 7 Pro 64bits, I will make an link in ContextMenu on "Deskop" and "My Computer" My setting have 1 Master Menu with 18 Sub-Commands and 1 Sub Menu with 5 Sub-Commands The Sub-Menu is not available Normaly i must have that : I make a simple test like that : why i can have more 17 link command in a ContextMenu? I check many informations on internet unsuvcessfull! find my scrit here and thank you in advance for some answers or solution Windows Registry Editor Version 5.00; Windows 7 Professionnel Service Pack 1;===========================================================; Menu Contextuel;===========================================================; ===================================; Menu Perso; ===================================;=========;Menu Maitre;=========--> Bureau[HKEY_CLASSES_ROOT\DesktopBackground\Shell\TechWan2003_bur]"MUIVerb"="TechWan2003""Icon"="%windir%\\system32\\LIB.DLL,7""Position"="Top""ExtendedSubCommandsKey"="Menu_Tech";--> Poste de travail[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\TechWan2003_Ord]"MUIVerb"="TechWan2003""Icon"="%windir%\\system32\\LIB.DLL,7""Position"="Top""ExtendedSubCommandsKey"="Menu_Tech";===============================; Menu_Tech;Sous-Command & Sous-Menu Menu Maitre;===============================;Sous-Command 1 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd01]"MUIVerb"="Ajout/Suppression de Programmes""Icon"="%windir%\\system32\\LIB.DLL,5"@=""[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd01\Command]@="rundll32.exe shell32.dll,Control_RunDLL \"appwiz.cpl\"";Sous-Command 2 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd02]"MUIVerb"="Gestionnaire de périphériques""Icon"="%windir%\\system32\\LIB.DLL,1"@=""[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd02\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\DevMgmt.msc";Sous-Command 3 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd03]"MUIVerb"="Gestionnaire des Disques";ligne de séparation vers le bas;"CommandFlags"=dword:00000040@=""[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd03\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\diskmgmt.msc";Sous-Command 4 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd04]"MUIVerb"="MSConfig - Utilitaire de configuration système";ligne de séparation vers le bas;"CommandFlags"=dword:00000040[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd04\Command]@="c:\\Windows\\System32\\msconfig.exe";Sous-Command 5 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd05]"MUIVerb"="Panneau de Configuration""Icon"="%windir%\\system32\\LIB.DLL,3"@=""[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd05\Command]@="rundll32.exe shell32.dll,Control_RunDLL";Sous-Command 6 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd06]"MUIVerb"="Console Services"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd06\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\services.msc";Sous-Command 7 - Menu Maitre;-------------------------------;Arrêter le Système[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd07]"MUIVerb"="[Arrêter 5'']""Icon"="%windir%\\system32\\LIB.DLL,2"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd07\Command]@="shutdown -s -f -t 5";Sous-Command 8 - Menu Maitre;-------------------------------;Redémarrer[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd08]"MUIVerb"="[Redémarrer 5'']""Icon"="%windir%\\system32\\LIB.DLL,6"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd08\Command]@="shutdown -r -f -t 5";Sous-Command 9 - Menu Maitre;-------------------------------;Fermer la Session[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd09]"MUIVerb"="[Fermer la Session 5'']""Icon"="%windir%\\system32\\LIB.DLL,0"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd09\Command]@="shutdown -l -f -t 5";Sous-Command 10 - Menu Maitre;-------------------------------;Outils d'Administration[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd10]"MUIVerb"="Outils d'Administration""Icon"="%windir%\\system32\\LIB.DLL,0"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd10\Command]@="control admintools";Sous-Command 11 - Menu Maitre;-------------------------------;Gestionnaire des Tâches[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd11]"MUIVerb"="Gestionnaire des Tâches""Icon"="%windir%\\system32\\LIB.DLL,0"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd11\Command]@="taskmgr";Sous-Command 12 - Menu Maitre;-------------------------------;Diagnostic de mémoire Windows[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd12]"MUIVerb"="Diagnostic de mémoire Windows""Icon"="%windir%\\system32\\LIB.DLL,0"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd12\Command]@="mdsched";Sous-Command 13 - Menu Maitre;-------------------------------;Gestionnaire des Tâches Planifiées[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd13]"MUIVerb"="Gestionnaire des Tâches Planifiées""Icon"="%windir%\\system32\\LIB.DLL,0"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd13\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\taskschd.msc";Sous-Command 14 - Menu Maitre;-------------------------------;Centre Réseau et Partage[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd14]"MUIVerb"="Centre Réseau et Partage""Icon"="%windir%\\system32\\LIB.DLL,0"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd14\Command]@="c:\\windows\\system32\\control.exe /name microsoft.networkandsharingcenter";Sous-Command 15 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd15]"MUIVerb"="Cartes Réseaux - NIC""Icon"="%windir%\\system32\\LIB.DLL,5"@=""[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd15\Command]@="rundll32.exe shell32.dll,Control_RunDLL \"ncpa.cpl\"";Sous-Command 16 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd16]"MUIVerb"="Vider le chache [IPConfig FlushDNS]"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd16\Command]@="C:\\windows\\system32\\cmd.exe /k ipconfig /flushdns";Sous-Command 17 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd17]"MUIVerb"="1 - Réinitialiser IP NIC"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd17\Command]@="C:\\windows\\system32\\cmd.exe /k ipconfig /Release";Sous-Command 18 - Menu Maitre;-------------------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd18]"MUIVerb"="2 - Renouvellement IP NIC"[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Cmd18\Command]@="C:\\windows\\system32\\cmd.exe /k ipconfig /Renew";Sous-Menu 1 - Maitre;---------------------[HKEY_CLASSES_ROOT\Menu_Tech\Shell\Menu1]"MUIVerb"="MMC""ExtendedSubCommandsKey"="Menu_Tech.SMenu1";==================================; Menu_Tech.SMenu1;Sous-Command & Sous-Menu - Sous-Menu 1;===================================;Sous-Command 1 - Sous-Menu 1;-------------------------------;Stratégie de Groupe[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM1]"MUIVerb"="Stratégie de Groupe"@=""[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM1\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\gpedit.msc";Sous-Command 2 - Sous-Menu 1;-------------------------------;Gestion de l'ordinateur[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM2]"MUIVerb"="Gestion de l'ordinateur"@=""[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM2\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\Compmgmt.msc";Sous-Command 3 - Sous-Menu 1;-------------------------------;Utilisateurs et Groupes Locaux[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM3]"MUIVerb"="Utilisateurs et Groupes Locaux"@=""[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM3\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\lusrmgr.msc";Sous-Command 4 - Sous-Menu 1;-------------------------------;Gestion des Disques[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM4]"MUIVerb"="Gestion des Disques"@=""[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM4\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\diskmgmt.msc";Sous-Command 5 - Sous-Menu 1;-------------------------------;Observateur des Evénements[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM5]"MUIVerb"="Observateur des Evénements"@=""[HKEY_CLASSES_ROOT\Menu_Tech.SMenu1\Shell\SM5\Command]@="c:\\windows\\system32\\mmc.exe /s c:\\windows\\system32\\eventvwr.msc"; ===================================; Menu Perso; ===================================
-
AutoUnattend.XMl Select operating system
mounir posted a topic in Unattended Windows 7/Server 2008R2
Hi every one! i try build an answer file Autounattend for DVD with WAIK! I have only one operating sysetm the selection of operating system not work (not hide automatiquetly) the options of language and keyborad is hidden well! for check on the version windows, i use two methode! i have these informations : index : 1 Nom : Win 7 RTM Pro FR x64 [M7V] Description : Windows 7 PROFESSIONAL i try use the key Index NAme or Description, but not work! Thank you, in advance for your help!