Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

MHz

Member
  • Posts

    1,691
  • Joined

  • Last visited

  • Donations

    $0.00 

Everything posted by MHz

  1. shorterxp, DT 3.46 setup is an executable which extracts an msi file to the %temp% directory. To get the msi: * Execute DT executable. * Click Install button. * Look in %temp% folder for an msi file with approximately 5 numbers or letters and a size of 813 KB. * Copy the msi file and rename the copy to something more meaningful. * Cancel the install. You can now use the msi file with arguments like /qn to perform a install silent. DT 4 is quite different and needs to be handled by a different method.
  2. Suitable compile directives added and added #RequireAdmin directive if run as not compiled. Scripts are still based on SlowView version 1.0 released in 2003. Silent Script: slowview_silent_updated.au3 Automated script: slowview_auto_updated.au3 Setting the variable $do_not_create_shortcuts to True will avoid creating shortcuts and thus no folder created in the Start Menu. If True, checks the "Do not create shortcuts" checkbox. Setting $move_wizard_window to False will not move the 2nd wizard window off the main screen. This script below has a fix for missing uninstall entries when selecting no shortcuts. slowview_auto_updated_uninstall_fix.au3 Installer: Get from brennig.com SlowView 1.0 - (January 2003, works on Windows 95/98/NT and newer)
  3. Your 1st line seems original. A person, like yourself, saying something and then using a contradiction will always be quite disturbing. This seems like a recurring pattern for you. Using a method of insult and then using a just kidding, but ..., however ..., and any other alternation does not hide the insult. To use a copy and paste of a movie quote used by Archie from the movie "The Fish called Wanda" is quite disingenious. So is the copy and pasted quote OK with me? I am not sure how to score such a non genuine statement from you. Silliness with the movie quote does not pass as sincere regret to me. I guess the joke is on me. MS-DOS exists in the Win 9x OSes as mentioned here. It details of how to boot into MS-DOS. So, it existed in Win 9x in one form or another and most possibly complies as an OS. So, as MS-DOS in 9x as being not a complete OS in its own right is very much in doubt considering an OS can be almost any operating environment.
  4. Sure , I was referring to the "usual plot" : http://www.msfn.org/board/topic/173609-btach-set-vast-with-echo-doesnt-work/#entry1096004 just kidding.... jaclaz I accept it as an insult else why the link? MS-DOS is a complete OS and QBasic is a part of it as I already mentioned. The comparison to batch is rather dry for my taste. Nice try again.
  5. jaclaz, QBasic is a part of MS-DOS 7.1 and offers a prompt. So, a nice try. Besides, VBScript did not exist in the era of MS-DOS AFAIK. Not much did exist for Microsoft at that time. Hard times then and I do not miss it. The more a programming language can do, the more flexible I find in using it. MS-DOS was/is differcult because of its limitations. Edit: Hmm, typing Microsoft adds a link to the Microsoft store. Such irony.
  6. A little more advanced BASIC was to use QBasic. Example test.bat could use: C:\DOS71\QBASIC /run test.basand test.bas in which QBasic interprets could use: REM Get the users input.INPUT "Enter the system Serial Number"; reply$REM Show the value of the reply.PRINT reply$REM Return to the system.SYSTEMSome examples shown in this PDF on page 14 for retrieving input from the user in QBasic. If you wanted the bas file compiled then the MS-DOS compatible version of FreeBasic could be used.
  7. Here are some specs gathered for your PC2 mainboards. The ASRock mainboard has various versions. Later versions are Gigabyte LAN. If you have version 1.0 or 2.0, then no Gigabyte LAN. http://www.asrock.com/mb/NVIDIA/ALiveNF7G-HD720p%20R1.0/ - Realtek PHY RTL8201CL - Speed: 10/100 Ethernet - Supports Wake-On-LAN - Supports PXE http://www.asrock.com/mb/NVIDIA/ALiveNF7G-HD720p%20R2.0/ - Realtek PHY RTL8201CL - Speed: 10/100 Ethernet - Supports Wake-On-LAN - Supports PXE http://www.asrock.com/mb/NVIDIA/ALiveNF7G-HD720p%20R3.0/ - Gigabit LAN 10/100/1000 Mb/s - Giga PHY Realtek RTL8211B - Supports Wake-On-LAN - Supports PXE http://www.asrock.com/mb/NVIDIA/ALiveNF7G-HD720p%20R5.0/ - Gigabit LAN 10/100/1000 Mb/s - Giga PHY RTL8211B - Supports Wake-On-LAN - Supports PXE The MSI mainboard is mentioned as Gigabyte though mentions at the bottom of the page that specs vary depending on area... , so could have different versions. http://msi.com/product/mb/880GMA-E45.html#hero-specification - Realtek PCI-E GbLAN controller 8111DL - Integrated Fast Ethernet MAC and PHY in single chip - Supports 10Mb/s, 100Mb/s and 1000Mb/s - Compliance with PCI-Express Bus specification v1.0a These mainboards may have settings for the LAN speed in the Bios though I would expect 1000Mb/s as default. Cat 5E cables are regarded as good for Gigabyte LAN. If your Router is saying that the LAN adapter is 100Mb/s and you are sure it is a Gigabyte, then I would check if a Bios update is available. Check for a LAN and chipset updated drivers.
  8. Depends on how much you can do by script. Manually doing it would be a PITA. Codepage affects the extended ASCII. This depends on the system language default that is set. It is not a BOM that defines codepage, but rather file encoding. If you look at the _FileWrite() function, you may noticed that I used FileGetEncoding() which gets the encoding that the file uses. I do not know probably half of those extensions and whether it is safe to use the Regular Expressions on those as they are designed for an ini file type structure. You may need to make Regular Expressions in different functions to be called by the detected file type.
  9. Have a look here. At least in Windows 7 is where your themes are saved. %LocalAppData%\Microsoft\Windows\ThemesTry customizing your theme in the Personalization panel, save it and then look at that path in Explorer. This may give your a theme that has been processed by the Personalization panel process. I have no understanding of your dll or the msstyles files and thus is out of my scope.
  10. You should be able to use *.* as first parameter and a folder as 2nd parameter. This is so long as you have only text based files in the source directory as no file type filtering is done by the script. Another way could be to rename the files adding a temporary extension i.e. file1.ini to file1.ini.text, file2.inf to file2.inf.text etc. Do a reformatini.exe *.text destfolder and then once done, rename the files removing the temporary extension. CMD For loop and using Rename should be able to do the mass file renaming. As for some whitespace which could be removed. The ini file format usually is not so spacious in its default API usage. i.e. Try this test. Requires reformatini.exe for the comparison. ; Create a default ini layout.IniWrite('test1.ini', 'section 1', 'key1', 'value1')IniWrite('test1.ini', 'section 1', 'key2', 'value2')IniWrite('test1.ini', 'section 2', 'key1', 'value1')IniWrite('test1.ini', 'section 2', 'key2', 'value2'); Clean the ini.RunWait('reformatini.exe test1.ini test2.ini'); Read the characters of the files into a variable.$test1 = FileRead('test1.ini')$test2 = FileRead('test2.ini'); Show some results.MsgBox(0x40000, @ScriptName, _ 'Size of test1 = ' & StringLen($test1) & @CRLF & @CRLF & _ $test1 & @CRLF & @CRLF & _ 'Size of test2 = ' & StringLen($test2) & @CRLF & @CRLF & _ $test2 & @CRLF _)I get this output. Size of test1 = 78[section 1]key1=value1key2=value2[section 2]key1=value1key2=value2Size of test2 = 88[section 1]key1 = value1key2 = value2[section 2]key1 = value1key2 = value210 characters are excess whitespace in the cleanup file as it adds spaces around the = character and adds spacing before section name lines. Something to consider. Minor changes to the Regular Expressions can change that result.
  11. The extra braces is forcing everything within them to be evaluated. In that example, they serve no meaningful purpose. Take care with something like that pattern as paths in your text files can have multiple spaces or tabs as an example which could break those paths. Adding (*UCP) at the beginning of each Regular Expression pattern may change the behavior of how certain characters are matched. I.e. \h may match unicode horizontal spaces as well as the ASCII + Extended ASCII horizontal spaces. So you can change this function to: Func _CleanIniFileContent($sContent) ; Trim whitespace from the end of each line. $sContent = StringRegExpReplace($sContent, '(*UCP)(?m)^\h*(.+?)\h*$', '\1') ; Remove horizonal whitespace on lines that have no other content. $sContent = StringRegExpReplace($sContent, '(*UCP)(?m)^\h+$', '\1') ; Remove empty lines. $sContent = StringRegExpReplace($sContent, '(*UCP)(\r\n|\n){2,}', '\1') ; Fix the spacing between the key values and the data values. $sContent = StringRegExpReplace($sContent, '(*UCP)(?m)^([^;#[])(.*?)\h*=\h*(.*)$', '\1\2 = \3') ; Trim the spacing from the quoted data values. i.e. " string " to "string". $sContent = StringRegExpReplace($sContent, '(*UCP)(?m)^([^;#[])(.+?) = "\h*(.+?)\h*"$', '\1\2 = "\3"') ; Add empty lines before section names. $sContent = StringRegExpReplace($sContent, '(*UCP)(?m)^(\[.+\])$', @CRLF & '\1') ; Trim both ends of the content. $sContent = StringStripWS($sContent, 0x3) Return $sContentEndFuncThis is untested so it may work OK or it may need to be updated to handle the different behavior. Edit1: Added extra info about using just \h+ in a pattern. Edit2: Created another version. v1.1. See below.
  12. Reshacker, hmm, not 64 bit compatible AFAIK. A shame really as it is renowned as being such a great program in its prime time. Even good programmers and their programs may need to retire. Cool. 1200 files, major BLEEP! By the time you have edited a couple of dozen or so, you could have a script to do the rest in seconds. Yeah, yeah, yeah, takes some known knowledge,though something to strive for. If Ultraedit is complaining about not being a DOS coded file then perhaps it thinks it is a binary file. A plain text file does not have a header yet alone a DOS header. Something strange may be going on there.
  13. Your welcome. I made it as a CUI i.e. console program so it can be used in a CMD script something like: if not exist subfolder md subfolderfor %%A in (*.ini) do reformatini.exe "%%~A" "subfolder\%%~nxA"Actually, you could do the above with it compiled as a GUI program though you would get no output in the CMD window. Look, I do not expect you to be a (professional,serious,whatever) programmer. Learning programming is like climbing a ladder. You go step by step. The rate of the climb is up to you. Do it as steep as you can handle. What I have learnt is not by magic but determination. You can probably be there one day. About regular expressions, I considered I could do it in 1 regular expression, I come close, but kept failing. So, bleep it, I did it over several expressions. Maybe not the best but got it done and if a bug is present then usually I can track it down to one of the expressions or needing another expression. PCRE may need unicode i.e. UCP turned on though I do not handle unicode characters in the patterns so hopefully it should not be needed. If I sound a little too advanced for you then say, hey, can you break this down. I will try though I may have lost some prior memory but I can only try to remember how I knew little about programming i.e. I may need to be reminded.
  14. Certainly something with Regular Expression support is suitable. Surprised that Perlscript cannot do it. But hey, AutoIt has Perl Compatible Regular Expression support . This is what I came up with. Many here seem to like using CMD scripts so I made this AutoIt script to be compiled as a CUI program. I am using AutoIt 3.3.10.2 at present which should be compatible with the latest version. ; Name of compiled file.#pragma compile(Out, 'reformatini.exe'); CUI program. Set to False for a GUI program.#pragma compile(Console, True); Bit x86|x64. Set to true for 64 bit program.#pragma compile(x64, False); AutoIt version. Tested on this version.#pragma compile(FileVersion, 3.3.10.2); What this file is meant for.#pragma compile(FileDescription, 'Reformat ini file content. Use /?, -? or -h for help.'); A name for the program.#pragma compile(ProductName, 'Ini File Reformat Tool'); Version for this program.#pragma compile(ProductVersion, 1.0.0.0)#NoTrayIconIf $CMDLINE[0] > 2 Then ; More then 1 parameter is not supported. ConsoleWriteError('Only maximum of 2 parameters is allowed.' & @CRLF) Exit 1ElseIf $CMDLINE[0] = 2 Then ; Read direct from the ini file. $sContent = FileRead($CMDLINE[1]) If @error Then ConsoleWriteError('Failed to read the file.' & @CRLF) Exit 2 EndIfElseIf $CMDLINE[0] = 1 Then Switch $CMDLINE[1] Case '/?', '-?', '-h' ; Help ConsoleWrite( _ 'Ini File Reformat Tool' & @CRLF & _ 'Outputs the reformatted content to the console or to a file.' & @CRLF & @CRLF & _ 'Pass 2 parameters as 1st being path to the source file and 2nd' & @CRLF & _ 'to the destination file. The file encoding of the destination file' & @CRLF & _ 'will be based on the source file encoding.' & @CRLF & _ ' i.e. "' & @ScriptName & '" source.ini destination.ini' & @CRLF & @CRLF & _ 'Or, pass 1 parameter as being the path to the source file.' & @CRLF & _ ' i.e. "' & @ScriptName & '" source.ini' & @CRLF & @CRLF & _ 'Or, pipe to this file.' & @CRLF & _ ' i.e. Type source.ini | "' & @ScriptName & '"' & @CRLF & @CRLF & _ 'Exitcode:' & @CRLF & _ ' 1 Only maximum of 2 parameters is allowed.' & @CRLF & _ ' 2 Failed to read the file.' & @CRLF & _ ' 3 No parameters and no input provided.' & @CRLF & _ ' 4 Failed to open the file for write.' & @CRLF _ ) Exit Case Else ; Read direct from the ini file. $sContent = FileRead($CMDLINE[1]) If @error Then ConsoleWriteError('Failed to read the file.' & @CRLF) Exit 2 EndIf EndSwitchElse ; Read from stdin. $sContent = '' Do $sContent &= ConsoleRead() Until @error If $sContent == '' Then ConsoleWriteError('No parameters and no input provided.' & @CRLF) Exit 3 EndIfEndIf; Clean the content from the ini file.$sNewContent = _CleanIniFileContent($sContent); Output the cleaned content.If $CMDLINE[0] = 2 Then ; Open the output file for erase and then write in the same encoding as the source file. $hWrite = FileOpen($CMDLINE[2], FileGetEncoding($CMDLINE[1]) + 0x2) If $hWrite = -1 Then ConsoleWriteError('Failed to open the file for write.' & @CRLF) Exit 4 Else ; Write the new content to the output file. FileWrite($hWrite, $sNewContent & @CRLF) FileClose($hWrite) EndIfElse ; Just output the new content to console. ConsoleWrite($sNewContent & @CRLF)EndIfExitFunc _CleanIniFileContent($sContent) ; Remove empty lines and trim whitespace from the end of each line. $sContent = StringRegExpReplace($sContent, '(?m)^\h*(.+?)\h*$', '\1') ; Remove horizonal whitespace on lines that have no other content. $sContent = StringRegExpReplace($sContent, '(?m)^\h+$', '\1') ; Remove empty lines. $sContent = StringRegExpReplace($sContent, '(\r\n|\n){2,}', '\1') ; Fix the spacing between the key values and the data values. $sContent = StringRegExpReplace($sContent, '(?m)^([^;#[])(.*?)\h*=\h*(.*)$', '\1\2 = \3') ; Trim the spacing from the quoted data values. i.e. " string " to "string". $sContent = StringRegExpReplace($sContent, '(?m)^([^;#[])(.+?) = "\h*(.+?)\h*"$', '\1\2 = "\3"') ; Add empty lines before section names. $sContent = StringRegExpReplace($sContent, '(?m)^(\[.+\])$', @CRLF & '\1') ; Trim both ends of the content. $sContent = StringStripWS($sContent, 0x3) Return $sContentEndFuncHere is a cmd script used to test it and the output. Use the executable like any one of these commands: Syntax: reformatini.exe /? | -? | -h Syntax: reformatini.exe source.ini [destination.ini] Syntax: type source.ini | reformatini.exe | is alternate except in the last command. [ ] is optional. Let me know how it works for you. Edit: Updated about the | not being an alternate in the last command which may have been confusing otherwise.
  15. Welcome Vespian, Here is something that may help. It is just the part that you requested help with. @echo offsetlocal enabledelayedexpansionrem Ensure regData is undefined now so it can be tested later if it has been defined.set "regData="rem Token 2 is %%A, which is expected to be REG_SZ. Used only to get to token *, which is %%B, which is all of the data value.for /f "tokens=2*" %%A in ( 'reg query "HKLM\SOFTWARE\Network Associates\ePolicy Orchestrator\Agent" /v ePOServerList') do set "regData=%%~B"rem If regData is not defined, then seems no good continuing?if not defined regData goto :stoprem Show the value of regData. Use delayed expansion as you can expect pipe characters in the string.echo regData=!regData!rem If substitution fails, then equality is true.if "!regData:CMCSU-EPO-01.cict.local=!" == "!regData!" goto :stoprem You only want to install framepkg.exe once. Need a flag variable to decide this i.e. if not %installed% ..."framepkg.exe" /Install=Agent /Silent:stoppauseendlocalgoto :eofAs mentioned in a comment, you only want to install framepkg.exe once so create a variable to use as a flag. Once the script installs framepkg.exe, then set the flag variable to a value i.e. 1. The you can test the variable later for value of 1 and not install if true. Use an initial value i.e. 0.
  16. The default menu in Windows 7 is basically a treeview control, at least the "All Programs" part of it is a treeview control. The left pane of Regedit has a treeview control. You would navigate the Regedit treeview control like you would navigate the Windows 7 Startmenu. Many other programs, such as Explorer uses treeview controls. Here is step by step instruction set for navigating the Windows 7 Startmenu to start Calculator. Number of key strokes may vary depending on your menu items. The order of key strokes is from top to bottom. Keys Destination---- -----------{Windows} Search edit control{Up} All Programs node{Left} Opened All Programs node{Down 2} Accessories node{Left} Opened Accessories node{Down} Calculator shortcut node{Return} Opened Calculator shortcut nodeNote----{Down}, {Up}, {Left} and {Right} are the arrow keys on your keyboard.{Down 2} = {Down} + {Down}These keys are consistent with using a treeview control created by the Win32 API (Application Programming Interface) and maybe some other APIs. The classic menu uses similar keys to navigate IIRC on Windows 95 and later version of Windows.
  17. The dynamic variables created by a for loop are case sensitive. %%A is different from %%a. So keep those to the same case.
  18. That was easy. With the case of variables, you can test that easy. Copied from a command prompt C:\> set NAME=JackC:\> echo %name%JackSeems to be case insensitive.
  19. sam240, Looks like your missng a parameter for imagex /apply. Look at the example at the bottom of the screen. 1 is used to set the image_number. Try changing it to: imagex /apply i:\lenovo\base\blank\%today%\image.wim 1 W:\
  20. vinifera, I am at a disadvantage with the alternative workings of a OSX desktop as I have not used an Apple based desktop since their initial introduction around 1980. On Windows, I usually set stuff stored on the desktop as hidden and show it when I want access to it. With Gnome 3 on a Linux distro, icons and stuff on the desktop is not allowed unless a configuration is modified and so I store no stuff on the desktop on Gnome 3. What I see you wanting is like a task based system when the desktop switches. Without my knowing of what OSX does about this, I see menus (possibly either as dynamic with desktop switching or the usual static type) as a resource for tasks. Though, what I see of both Windows (8 + 2) 10 and with Gnome 3 is that menus are rather lacking in functionality. The Gnome 3 developers looked into task based (virtual) desktops and seem to have given up on it. I have little confidence in Microsofts wannabe Desktop-Phone-XBox-Tablet-Netbook All-In-One OS is going to achieve any better. If I get a chance, I will have a look at an OSX desktop. I believe KDE >v4.0 on a Linux distro has a task based system built in and may need to look into how they implement it into (virtual) desktop switching.
  21. Updated my last post with an edit. One of the rare times that I chose to omit ENABLEDELAYEDEXPANSION when it was actually needed. Hey, perhaps I deserve this threads award for a simple yet stupid mistake.
  22. You have me curious. What complies as a REAL virtual desktop? I can think of a few things possible with virtualization though I would like to know your actual view on this subject.
  23. Along with jaclaz idea, a symlink could be created as well. May as well create a symlink for static path handling and use the last.ini for reference to the last date. The use of a static path can help with WAIK tools or similar and less maintenance of suggested code in other scripts that also access the image file. This code is not tested so let me know if issues exist so I can fix it. I expect it to work though I have been wrong before. @ECHO OFFSETLOCAL ENABLEDELAYEDEXPANSIONrem # Set the date to a variable named Today.SET Today=%date:~10,4%-%date:~4,2%-%date:~7,2%rem # Make a folder for Today.IF NOT EXIST i:\lenovo\base\blank\%Today%\ MD i:\lenovo\base\blank\%Today%rem # Capture the image to Todays folder.imagex /compress fast /capture D: i:\lenovo\base\blank\%Today%\image.wim "Laptop Base Image"rem # Write Todays date to last.ini and symlink the image if no error detected from imagex.IF ERRORLEVEL 1 ( rem # Output the detection of an imagex error. >&2 ECHO Error !errorlevel! set by imagex. >&2 IF EXIST i:\lenovo\base\blank\%Today%\image.wim ECHO Image does exist in Todays directory.) ELSE ( rem # Write the last date to last.ini. (ECHO TheLast=%Today%)>i:\lenovo\base\blank\last.ini rem # Remove the last symlink as mklink does not overwrite. IF EXIST i:\lenovo\base\blank\image.wim DEL i:\lenovo\base\blank\image.wim rem # Create symlink in the blank directory to Todays image. mklink i:\lenovo\base\blank\image.wim i:\lenovo\base\blank\%Today%\image.wim IF ERRORLEVEL 1 >&2 ECHO Error !errorlevel! set by mklink.)ENDLOCALGOTO :EOFEdit: Added ENABLEDELAYEDEXPANSION to expand errorlevel variables used between () rounded braces. This affects only error message output displaying the value of the variable of errorlevel though is still misleading if error output is always seen as an unset value or as 0. Note, Reference of errorlevel variable is %errorlevel% changed to !errorlevel!. As per usual for testing, add the word PAUSE on a separate line immediately before or after the use of ENDLOCAL to pause the script and see any error output if issues occur.
  24. FileVerifier++ has many hash algos which you could try. It has a CLI named fvc.exe. If I add your checksum output into a file named hash.txt and use this code: @echo offsetlocal enabledelayedexpansionfor /f "tokens=1-2 delims= " %%A in (hash.txt) do ( set "hash=%%A" set "file=%%B" rem Remove ?SHA1* which is 6 characters trimmed from the 2nd token. set "file=!file:~6!" if not "!hash:~1!" == ";" ( echo !hash! !file! ))endlocalgoto :eofI get an output of: 778e7656fa79a073adbee3be578b50e8c58e7f5a files.7z.001860993761f8420c84430d945b4f31379f49bc2f7 files.7z.002ef996f72db0131b9983fb0f18f823a81418b34cc files.7z.003Seems clean AFAIK.
  25. Hello radix, IMO, best place to look at first is the command For /?. Look for the usebackq option. Quote from For /?: To change behaviour of how quoting works, use the backquotes option. Using the backquotes option allows you to use double quotes to brace the variable that stores the path that may also have some whitespace. FOR /F "usebackq delims=" %%l IN ("%%f") DO (

×
×
  • Create New...