Показаны сообщения с ярлыком Windows 7. Показать все сообщения
Показаны сообщения с ярлыком Windows 7. Показать все сообщения

четверг, 7 ноября 2019 г.

Ссылки в Windows, символьные и не только


    Предыстория



    Сразу оговорюсь, что под ссылками в Windows я понимаю ссылки в NTFS. В FAT механизмов ссылок, насколько мне известно, предусмотрено не было.

    Ядро Windows поддерживает следующие виды ссылок:
    • Hard Links — жёсткие ссылки, как в *nix. Доступны начиная с Windows NT4.
    • Junction Points — аналог символических ссылок. Доступен начиная с Windows 2000 (NTFS 5).
    • Symbolic Links — символьные ссылки. Доступны начиная с Windows Vista.
    Если вы никогда не имели дела с символическими и жёсткими ссылками, но хотели бы узнать о них, советую прочитать отрывок из документации файлового менеджера FAR, спасибо хабрачеловеку allemeine. Там говорится только о Hard Links и Junction Points, но этого вполне достаточно. Symbolic Links действуют так же, как и Junction Points, с той разницей, что могут указывать на файлы (и реализованы в Windows по-другому).

    Hard Links можно создавать только на файлы, Junction Points — только на директории, Symbolic Links — на файлы и директории. В дальнейшем под «жёсткими ссылками» подразумеваются Hard Links, под «символьными» — Junction Points и Symbolic Links.

    Жёсткие ссылки действительны в пределах одного раздела, символьные — могут пересекать границы разделов. В связи с этим символьные ссылки могут поломаться, если структуру разделов поменять.

    Не со всем, что поддерживается ядром, умеет нормально работать эксплорер. Будьте осторожны при использовании Junction Points в версиях Windows до Vista. При удалении Junction Point эксплорер может залезть внутрь директории, на которую ссылается Junction Point и поудалять там всё, а затем удалить Junction Point, хотя должен лишь удалить ссылку. Наверняка могут возникнуть проблемы и при перемещении или копировании Junction Point'ов.

    Мне неизвестно, нормально ли в версиях Windows до Vista относятся к Junction Points стандартные утилиты типа rmdir.

    Дополнительные материалы по теме


    Отмечу англоязычную статью, в которой описаны нюансы использования ссылок и некоторые программы, позволяющие с ними работать. Статья устаревшая, так что в ней говорится только о Hard Links и Junction Points (причём на последние в статье нередко ссылаются, как на symbolic links...).

     хорошее описание всех видов ссылок есть ещё в справке по NTFS Links (дополнению для Total Commander, см. ниже).

    Софт


    Теперь можно перейти к рассмотрению программ для работы со ссылками. Да-да, если вы не пользуетесь FAR (см. ниже), вам понадобятся отдельные программы. Все программы, перечисленные ниже, бесплатны.

    Утилиты от Microsoft

    Windows >= Vista

    В Windows Vista добавили команду mklink для создания символьных и жёстких ссылок

    Windows >= 2000

    fsutil hardlink create ссылка файл

    Создаёт Hard Link на файл (источник).

    linkd ссылка директория

    Создаёт Junction Point на директорию (источник). Утилита входит в Microsoft Windows Resources Kit.

    Расширения для Explorer

    NTFS Link интегрируется в Explorer и добавляет во всплывающее меню, появляюшееся после перетаскивания правой кнопкой мыши, пункты «Create junction point» и «Create hard link». Кроме того, она перехватывает вызовы Explorer'а, обеспечивая нормальное перемещение/копирование/удаление созданных ссылок.

    NTFS Links (не путать с дополнением для Total Commander, см. ниже) — абсолютно аналогичная программа.
    Я рекомендуюLink Shell Extension — аналогичная программа, обладающая расширенным функционалом и очень подробным описанием.

    NTFS Links — дополнение для Total Commander

    Страница программы  Плагин может запускаться как отдельная программа, вне Total Commander'а.

    FAR

    Консольный файловый менеджер FAR уже давно поддерживает Hard Links и Junction Points «из коробки». Для создания ссылки используйте сочетание клавиш Alt-F6 ;-)

    Junction Link Magic

    Junction Link Magic — программа с графическим интерфейсом для создания, изменения и модификации Junction Points.

    Junction — консольная программа для создания Junction Points

    Junction лучше, чем linkd, тем, что не нужно тащить весь Resource Kit :-)
    .

    среда, 1 мая 2019 г.

    10 Free Tools To Save or Print a List of File and Folder Contents

    Whether you need to do so for yourself or for someone else, there is sometimes a need to create a listing of the contents of a particular directory, set of directories or a whole drive. With the size of hard drives today, keeping track of all the data files stored on them is handy and it can be useful to catalog file collections and folders so you know what’s buried deep down inside multiple folders as well as what’s in the root folder.
    There are very simple ways of doing this without software and one is by using the command “Dir [folder] > File.txt” from the command prompt, but why play around in a DOS window when you don’t have to? Here’s a selection of 10 free tools to save or print out content lists of the files inside your folders in various ways including plain text or an HTML document.
    1. Arclab Dir2HTML
    Dir2HTML
    Dir2Html is a tool which is free for personal and commercial use and has a number of useful options to aid in the creation and customization of the HTML index file. It supports recursive folder indexing, a simple file mask, create a sub-section for each subfolder, exclude hidden files and folders, include size, date and many other options. The right side of the window allows you to tailor the output HTML file visually and you can add a customized title, alter the font sizes, colors and resize different areas of the output. Dir2Html has a lot of options but many of them you can leave to the defaults if the standard layout is good enough. Compatible with Windows XP, Vista and 7.

    2. DirLister
    DirLister
    DirLister is quite a simple tool which will give you a file and folder list, including a recursive mode to go into sub directories, and then output the result to an HTML or plain text TXT file. There aren’t many options to configure apart from a simple file mask and the option to include the file sizes or just display the file names. It also creates a right click context menu entry called List Drive which will create and open a file for the directory you click on in the format using the options from the main window. Tested on Windows 7.

    3. DIR2HTML
    DIR2HTML
    Rather strangely this DIR2HTML tool needs installing even though the program itself is a standalone executable file of only 37KB and can easily be made portable. Although the main window is small there are quite a few options crammed in there to tailor the output HTML file to your liking. Recursive directory depth, size, time, date, sort by, size type and a simple file mask are all options that can be used. If you enable the Make Links and Link only Directories boxes the saved HTML file will have a full hyperlink directory structure to browse. Even though it’s from 2001, DIR2HTML worked great on Windows 7 64-bit.
    TIP: Make sure to create a separate folder for the HTML file to go in because the program will create a full directory structure for each sub directory included in the list and place an HTML file for the file contents inside each one.

    4. Directory List & Print
    Directory List & Print
    The free version of Directory List & Print is a severely cut down version of its shareware offering and the first thing you will notice about the program is just how many options are grayed out in this version, and you also get a 5 second nag at the start. One of the few things to be usable though which many users could find useful is the option to output the result directly to Word or Excel, or you can print or copy to the clipboard, although even saving to plain text is disabled. There is also the ability to include file sizes, dates, times, attributes and extensions. On testing we found the program to be far slower to process the lists than many of the other smaller and older portable tools available here.

    5. Karen’s Directory Printer
    Karen's Directory Printer
    Directory Printer has been a popular tool for several years for printing and saving file and folder lists because of the sheer amount of options you can configure to get the output to your liking. Both files and folders have 12 bits of information that can be displayed including date, size, attributes, version and specific folder / sub folder details. Also included is a file mask filter that already has 5 common format presets built in for images, music etc. There are various tick box options for hidden / system or read only files, including sub folders in the display and a few file sorting options. The separate Print and Save to disk tabs have a few different options to allow you to set different output styles.
    The last couple of things worth a mention are there’s a right click context menu function and the only truly useful output file is a text file. HTML and Excel / Word save options would have probably made Directory Printer almost untouchable in its field. Although it requires installation, you can copy the executable from its folder and use as a portable program. Works on Windows XP and above.
    6. JR Directory Printer
    JR Directory Printer
    JR Directory Printer is a portable 200KB executable that is able to scan your folders and sub folders and then output the resulting list by opening it directly in your default text editor such as Notepad or Notepad++. Size, date and time and attributes can be included / excluded from the list and you can put a limit of the name length or even choose to display DOS style file names. Although JR Directory Printer dates back to 2001 it still works perfectly fine on Windows 7 including 64-bit.

    7. DirLister
    DirLister
    Not to be confused with the other DirLister program above, this one is by Barrysoft and is a less than a 500KB portable executable with a few additional options users could find useful. These are the output types of the file to be saved because you can save to plain text, an Excel file or an HTML page and also with tab and space separated versions. There’s an option for multiple file masks if for example you want to list different types of music or image etc, and the program is able to scan down into sub folders and include hidden files in the list. The scanning is also pretty fast and a full C drive scan output to HTML file took about 5 seconds. Works on Windows XP to 7.

    8. Snap2HTML
    Snap2HTML
    Snap2HTML is a portable tool that is able to generate a single HTML file that lists all folders and files that you ask it to. What makes this program a bit different is the great way it creates the HTML file that looks and behaves a lot like Windows Explorer complete with an expandable tree view down the left and also a handy search option. The configuration options are few with only really tick boxes to provide hidden or system files, and the Link files tick box will make all the files into links so you can execute a file directly from the HTML document. Snap2HTML runs on all versions of Windows from 95 upwards.

    9. DriveZ
    DriveZ
    DriveZ is a utility with not much in the way of features or functions, but the fact it’s a small portable executable of only 44KB makes DriveZ an ideal program to have around or as an addition to a USB toolkit. DriveZ does a simple job of creating a list of file and folder names from a specified directory and then copying it to the clipboard. You can choose to include files or folders, remove file extensions or include a file name mask which the MP3 tick box will enter *.mp3 into the Mask box. The Preferences menu gives 1 option which is the useful function of adding a right click Explorer context menu entry for the program. Tested on Windows 7.

    10. PrintFolder
    PrintFolder
    The free version of PrintFolder is probably best described as a slightly more advanced version of the DriveZ tool above that needs to be installed. It also cannot recurse into sub directories and instead only shows the top level file and folder contents, but does have the options to include date, time and file size in the list. The Options tab gives a few formatting options such as font size and whether to include lower case names and system folders etc, and the output can be copied to the clipboard, saved to a TXT file or printed. The developer does mention a few bugs in Windows 7 on the website, but the right click context menu option seemed to work fine for us.

    List of freeware tools and other releases from The Windows Club



    FixWin 10 for Windows 10 is a portable freeware that allows you to fix and repair Windows 10 problems, issues, and annoyances.
    Ultimate Windows Tweaker 4 for Windows 10, apart from offering you the usual tweaks, lets you tweak Privacy settings and more.
    10AppsManager will let you easily uninstall and reinstall Windows Store apps in Windows 10.
    AltPlusTab lets you customize Alt+Tab menu in Windows 10.
    Thumbnail and Icon Cache Rebuilder for Windows 10 will purge, clear and delete your Thumbnail and Icon Cache Rebuilder in a click.
    Ultimate Windows Tweaker 3 for Windows 8 and Windows 8.1 is just 340 KB in size and includes over 170 tweaks.
    Ultimate Windows Tweaker 2.2 is a freeware TweakUI Utility for tweaking and optimizing Windows 7  & Windows Vista, 32-bit & 64-bit.
    FixWin v1 for Windows 7 is a 529 KB freeware portable application to repair & fix common Windows  and Windows Vista annoyances & issues
    FixWin v2 for Windows 8 is a free portable application to repair & fix common Windows annoyances & issues in Windows 8, and Windows 8.1.
    Ultimate Windows Customizer lets you customize Windows Explorer, Context Menus, Libraries, Logon Screen, Start Orb, Taskbar, Windows Media Player and many areas of Windows 7 and Windows 8.
    Fix IE Utility re-registers all the concerned dll & ocx files required for the smooth operation of Internet Explorer.
    Fix WMP Utility is a portable app which re-registers all the concerned Windows Media dll files required for the smooth functioning of Windows Media Player.
    Fix MSE Utility is a portable utility which will reset all the Registry and other settings of Microsoft Security  Essentials to its default value. This utility will restore all its registry values & service settings to known good defaults, without re-installing MSE. It also re-registers the concerned .dll and .exe files, required to run MSE properly.
    Fix WU Utility will re-register the files, required for the proper functioning of Windows Updates. This utility will re-register a total of 114 .dll,  ocx and .ax files which are required for the proper functioning of Windows Updates.
    Windows Themes Installer is a freeware portable utility which allows you to install a theme, remove a theme and restore defaults easily.
    Winter White Windows 7 Theme, includes screensaver, cursor set, wintry wallpapers.
    Windows 7 Start Button Changer allows you change the Windows 7 Start Orb or Button easily. The program will backup you original explorer.exe, change the start button and restart explorer.exe. To restore the default Start Orb and explorer from the backup, click Restore Original Explorer Backup.
    Right-Click Extender for Windows is a freeware utility which allows you to add some important items to the right-click context menu. It allows you to add or remove  many additional options to a Drive, File, Folder, Computer and Desktop’s Right Click Context Menu.
    Prevent  stops Cut, Stops Paste, Stops Copy, Stops Delete, Stops Copy To, Stops Move to, Stops Send To,  Prevents renaming, Disables Task Manager’s End Process button. It also grays out the context menu items, disable Ctrl+C, Ctrl+X and Ctrl+V and/or stops the process.
    Windows Access Panel is meant to minimize your trouble in accessing certain programs in Windows.
    Handy Shortcuts will help you create the oft-used desktop shortcuts for your Windows desktops easily: Lock WorkStation, Switch Account. Shutdown, Restart, Log Off, Hibernate, Show Desktop, Uninstall Programs, Device Manager, Security Center, Windows Defender, Windows DVD maker, etc.
    The Windows Feeds Gadget displays the RSS Feeds of The Windows Blog and The Windows Club. Stay abreast with whats happening in the world of Windows!
    CleanDesktop is a small portable freeware app which will help you clean up your unused desktop icons, in Windows 8, Windows 7 & Vista. This utility is for those who miss the XP’s wizard.
    I’M A PC Themepack and Wallpapers for Windows 7 and Windows 8.
    The Complete Windows 7 Shortcuts eBook includes a lot of new keyboard shortcuts that are unknown to a new user. This eBook comprises of more than 200 keyboard shortcuts containing almost all the keyboard shortcuts that are available in Windows 7 and its default programs.
    Windows 7 for Beginners eBook which covers topics which would typically interest a novice wanting to start using Windows 7 or a beginner trying to get his hands wet on Windows 7.
    Quick Restore Maker is a smart 1-click freeware app for creating a System Restore Point in Windows 10, Windows 8/7 & Vista.
    GodMode Creator is a freeware utility which lets you create 38 “GodModes” in Windows 10/8, Windows 7 & Vista, with a click.
    SMART (Service Management And RealEasy Tweaking) Utility for Windows 7 is a freeware utility which helps you tweak Windows 7 Services, based on the suggested configurations of BlackVipers.
    Context Menu Editor for Windows 8, Windows 7 & Vista. Context Menu Editor is a freeware tweaking utility to add/delete application shortcuts, Win32 commands, files, and website URLs to your desktop and folder context menu.
    Quick Clean for Windows 8, Windows 7 & Vista is a freeware tool which lets you  clean up the junk files from your Windows desktop quickly.
    Taskbar Thumbnail Tweaker & Resizer for Windows 7 makes Taskbar Previews appear faster or increase taskbar thumbnail preview size easily!
    Windows 7 Taskbar Thumbnail Customizer allows you to resize & tweak the Windows 7 taskbar thumbnails left & right, in & out! You can change the size of the thumbnail, its spacing, top, bottom, left, right margins and mouse delay time too!
    File Association Fixer v2 for Windows 10 / 8 / 7 will be able to easily help you fix, repair and restore the broken file associations.
    File Association Fixer lets you fix file type associations easily, with a click! To fix the association for a particular file type simply click on the file type association icon or name. These pages contain the file association fixes for some of the most common file types. Currently, the app offers 18 fixes for Windows 7 & 26 fixes for Windows Vista
    ws Themes Installer is a freeware portable utility which allows you to patch system files, install a theme, remove a theme and restore defaults easily in Windows 7 & Vista.

    OneWorld Theme For Windows 7 changes the Task Pane & the Welcome Center too and is thus a ‘first of its kind‘ theme for Windows 7. We may think we are different … of different nationalities … of different color or cultures, but every once in a while we need to be gently reminded that, we are ONE … and ALONE in the Universe.
    Royale Blue Theme For Windows Vista is a theme you may want to check out!  Those of you who miss the Royale Blue XP Theme, may want to try this Royale Vista theme.
    Windows 7 Regional ThemePack for Asia takes you to a journey in Asia. Visit countries from Japan to Taiwan, from Thailand to India, China to Hong Kong and Malaysia. See if you can recognize the 12 sights. Enjoy the change every hour, every day !
    Hide Taskbar lets you hide only the taskbar, and not the Start Button, with a click. Simply download and run the app. Use hotkeys Ctrl+Esc  to hide or un-hide the taskbar.
    Windows 7 DreamScene Activator is a small freeware portable app which will allow you to activate DreamScene in Windows 7 too! Those of you who missed the DreamScene feature of Windows Vista  Ultimate, in Windows 7, can now add it easily to Windows 7 and Windows 8.
    Windows 7 Folder Background Changer is a freeware portable application which allows you to change the  folder backgrounds in Windows 7. You can also change the color of the text and show shadows under the text and  even apply the same background to all the subfolders!
    QRM Plus Manager lets you create restore points, carry out system restore operations & selectively delete system restore points in your Windows computer. You can also add these options to your right-click context menu.
    System Restore Manager is a freeware portable utility which allows you to completely manage your Windows system restore points and customize its options. Using this utility, you can even select a Drive and change the maximum amount of disk space to use, System Restore can use, change the System Restore Point Creation Interval, etc.
    Start My Day is a first of its kind freeware process launcher for Windows users. Simply put, Start My Day is for those users who hate going through the same process each day, loading this and that.
    Create A Shortcut adds the ability for a user, to select where to create a shortcut for a file system object, from anywhere on a users computer.
    Sliced Themepack & Wallpaper set for Windows 7 comprises of 7 beautiful abstract wallpapers. Various colors have come together to play with black to bring out a mysterious glazed glass look.
    Icon Cache Rebuilder repairs and rebuild a corrupt icon cache in Windows easily in a click.
    Windows Logon Notifier lets you create user logon messages for Windows 7 and Windows 8 users easily.
    IE 9 Tweaker, which lets you tweak some select settings of Internet Explorer 9 easily. The main feature of IE9 Tweaker is the ability to create your own customized Homepage similar to IE9  About:Tabs page. You can also make IE9 show more rows in the about:tabs page. Please also see IE9 Tweaker Plus.
    HomePage Maker, is a freeware portable app that allows you to customize your Internet Explorer, Firefox, Chrome & Opera browser home page.
    Windows Event Viewer Plus is a portable freeware app that lets you view Event Logs faster than the default in-built Windows Event Viewer and also export the Entry to a text file, select the Web Search Button to look up the entry online, to find out more information or troubleshoot errors.
    WP7 MarketPlace Enabler allows you to access the MarketPlace from anywhere in the world via your Zune software.
    The Ultimate Guide to Speech Recognition in Windows 7 explains everything about a superb feature of Windows 7 which is called as ‘Speech Recognition’. Speech Recognition is a technology which is used for controlling computers using some voice commands and that too, very accurately.
    Windows 8 Clock Logon Screensaver for Windows 7 has been inspired by Microsoft’s next version of the Windows operating system.
    IE9 Tweaker Plus allows you to tweak, customize and change over 27 settings in Internet Explorer 9 RTM, all from one single window.
    C# Tips, Tricks for Beginners eBook will help you learn the basics of C sharp programming, tips, tricks tutorials the easy way.
    RegOwnit allows you to take ownership of a Windows Registry key using Administrator, Home Users or the current Logged On User account.
    AeroTile is a freeware portable app that adds glassy backgrounds to system folders and places them on your Windows desktop to give you ready access to these folders.
    Ease Of Access Replacer replaces Ease of Access button on Windows 7 or Windows 8 Logon Screen with buttons to take out Lock Screen and Logon Screen Screenshot, CMD, Powershell, Registry Editor, Run and Task Manager.
    System Folders Customizer lets you add Internet Explorer, important System folders, Control Panel applets to your Computer folder, Libraries and Desktop.
    Right Click Restart Explorer is a simple tool that adds Restart explorer to your right-click context menu.
    QuickHide hides taskbar processes, programs and applications quickly. And why would you want to do that? Maybe you are doing something you shouldn’t be doing and your dad or Boss comes in … QuickHide could be a life saver – by letting you hide all in a click!
    RightClick ReplaceThis allows you to replace files in Windows 7 easily. It is also helpful in cases where Windows will not allow you to replace files which are being used.
    Show Desktop Remover is a freeware tool that lets you easily remove and restore the Show Desktop button appearing in the right side of Windows 7 taskbar.
    Taskbar Shadow is a small tool that adds a cool drop shadow effect to the Windows 7 taskbar. It  creates a shadow for the taskbar in any position – bottom, top, right or left!
    Taskbar Color Effects lets you add Color, Background and Shadow Effects to the Windows 7 Taskbar.
    PinToStartMenu adds the ‘Pin to start menu’ item to the context menu of folders and the Control Panel applets and lets you pin Control Panel items and folders to Windows Start Menu, via your right-click context menu.
    Disguise Folders is a free tool that lets you camouflage your secret folders and allows you to disguise them as system folders in Windows.
    HotShut is a free tiny app which lets you do something very simple. It lets you shutdown, restart, lock or log off your Windows computer instantly from your taskbar notification area.
    MailMyFile lets you mail your files to your preferred mail ID, directly quickly and from your right-click context menu.
    Web Pinner is a freeware app that can add website links to your Windows 7 desktop’s right-click context menu, quickly and easily.
    The Ultimate Laptop Buyers Guide. Planning to buy a new laptop but don’t know which laptop to buy, with so options out there? Unsure if you need a business style laptop or a personal laptop for your home needs? If so, then this Laptop Guide from The Geeks Club is something you definitely want to read.
    The Ultimate Tablet PC Buyers Guide. This 40MB guide from The Geeks Club consists of 49 pages will guide you through your decision of buying a Tablet PC.
    Metro UI Tweaker for Windows 8 is a freeware tool, designed to allow you to tweak Metro UI settings in Windows 8.

    Start Button ToolTip Text Changer will allow you to change the tooltip text of your Start Button or Orb in Windows 7. Feel free to replace the default text ‘Start‘, with any text of your choice, in the text-box. You can replace it with your name or simply choose something witty.
    WLM Blocked Sender Tool lets you manage Blocked Senders List in Windows Live Mail. Add, Remove address, export, save, import blocked senders list in Windows Live Mail easily.
    Autorun Deleter is a free program which disables and deletes the Autorun.inf virus. If you find that a removable media is infected with the autorun.inf virus, simply run this tool. It will delete the file and make a change in the Windows registry to ensure that it does not appear again.
    Balloon Tip Time Changer is a simple tool that lets you customize and set your own time for the balloon tips or Windows notifications to stay open in your taskbar notification area.
    Ribbon Icons Customizer will let you change the icons on the Windows 8 explorer. It lets you change even its default icons, with a click.
    InstaMailer will allow you to quickly send an email to any email ID using your Hotmail and Gmail accounts. This software will be especially useful in situations where you need to quickly send out mail to someone,and you don’t want go through the process of opening the web interface or your default mail client.
    WinMailer is a stand-alone freeware, that will allow you to quickly send an email, along with attachments, to anyone using your Hotmail, Gmail, Yahoo, AOL or any other email account, right from your Windows desktop.
    Start Orb Mover will allow you to move the Start Button and the Start Menu to either the center of the Taskbar or far right\bottom, depending on Taskbar location.
    Windows 8 Aero Lite Tweaker lets you enable the Aero Lite Glass theme in Windows 8.
    WiFi Profile Manager 8 is a simple tool to view your Preferred Wireless Network Profiles in Windows 8. This tool tries to replace the functionality of the Wi-Fi Preferred Network dialog box of Windows 7.
    Modern Tile Maker for Windows 8 will allow you to create Modern or Metro style Tiles for Files, Folders, Desktop Programs, Web links and more. The tiles actually appear like a Metro UI tile – similar to how the Metro apps tiles look.
    Windows Screen Capture Tool will allow you to capture full screen, selected screen area, windows, web pages and more. You can also add watermarks to your captured screenshot or edit the image using its basic image editor.
    PassBox is a handy little tool that will remember all your passwords. It can even suggest or generate strong passwords for your account.
    Tile Locker prevent users from pinning, unpinning, rearranging Tiles on Windows 8 Start Screen.
    Windows Program Blocker is a free App or Application blocker software to block software from running on Windows.
    ScreenOff is a 13KB freeware that lets you turn off your Windows laptop monitor screen manually on-demand in a click, without putting it to Sleep.
    Windows Tile Color Changer is freeware for Windows 10 / 8.1 / 8 allows you to change the color of pinned Tiles of your desktop apps, on your Start Screen.

    суббота, 13 апреля 2019 г.

    Merge all CSV or TXT files in a folder in one worksheet

    Merge all CSV or TXT files in a folder in one worksheet
    Example 1
    Merge all data from the csv files in a folder into a text file

    Note: with a few small changes you can also use this for txt files. Replace *.csv for *.txt

    1) Windows Start Button | Run
    2) Type cmd and hit enter ("command" in Win 98)
    3) Go to the folder with the CSV files (for help how to do that enter "help cd")
    4) Type copy *.csv all.txt and hit enter to copy all data in the files into all.txt.
    5) Type exit and hit enter to close the DOS window

    Now we must import the text file all.txt into Excel.

    1) Open Excel
    2) When you use File Open to open all.txt the Text Import Wizard will help you import the file
    3) Choose Delimited
    4) Next
    5) Check Comma
    6) Finish



    Example 2
    This code will ask you to browse to the folder with the csv files and after you click OK in this dialog
    it merge all data into a txt file and then import and save it into a Excel file for you.

    Copy the code below into a normal module of a workbook :

    Alt-F11
    Insert>Module
    Paste the macro
    Alt q to go back to Excel
    Alt F8 to open your macro list
    Select Merge_CSV_Files and press Run

    There is no need to change anything in the code example for csv files to test it.
    But read the Tips below the macro if you not get the result you want.

    Option Explicit

    #If VBA7 Then
        Private Declare PtrSafe Function OpenProcess Lib "kernel32" _
            (ByVal dwDesiredAccess As Long, _
            ByVal bInheritHandle As Long, _
            ByVal dwProcessId As Long) As Long
       
        Private Declare PtrSafe Function GetExitCodeProcess Lib "kernel32" _
            (ByVal hProcess As Long, _
            lpExitCode As Long) As Long
    #Else
        Private Declare Function OpenProcess Lib "kernel32" _
            (ByVal dwDesiredAccess As Long, _
            ByVal bInheritHandle As Long, _
            ByVal dwProcessId As Long) As Long
       
        Private Declare Function GetExitCodeProcess Lib "kernel32" _
            (ByVal hProcess As Long, _
            lpExitCode As Long) As Long
    #End If


    Public Const PROCESS_QUERY_INFORMATION = &H400
    Public Const STILL_ACTIVE = &H103


    Public Sub ShellAndWait(ByVal PathName As String, Optional WindowState)
        Dim hProg As Long
        Dim hProcess As Long, ExitCode As Long
        'fill in the missing parameter and execute the program
        If IsMissing(WindowState) Then WindowState = 1
        hProg = Shell(PathName, WindowState)
        'hProg is a "process ID under Win32. To get the process handle:
        hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, hProg)
        Do
            'populate Exitcode variable
            GetExitCodeProcess hProcess, ExitCode
            DoEvents
        Loop While ExitCode = STILL_ACTIVE
    End Sub


    Sub Merge_CSV_Files()
        Dim BatFileName As String
        Dim TXTFileName As String
        Dim XLSFileName As String
        Dim FileExtStr As String
        Dim FileFormatNum As Long
        Dim DefPath As String
        Dim Wb As Workbook
        Dim oApp As Object
        Dim oFolder
        Dim foldername

        'Create two temporary file names
        BatFileName = Environ("Temp") & _
                "\CollectCSVData" & Format(Now, "dd-mm-yy-h-mm-ss") & ".bat"
        TXTFileName = Environ("Temp") & _
                "\AllCSV" & Format(Now, "dd-mm-yy-h-mm-ss") & ".txt"

        'Folder where you want to save the Excel file
        DefPath = Application.DefaultFilePath
        If Right(DefPath, 1) <> "\" Then
            DefPath = DefPath & "\"
        End If

        'Set the extension and file format
        If Val(Application.Version) < 12 Then
            'You use Excel 97-2003
            FileExtStr = ".xls": FileFormatNum = -4143
        Else
            'You use Excel 2007 or higher
            FileExtStr = ".xlsx": FileFormatNum = 51
            'If you want to save as xls(97-2003 format) in 2007 use
            'FileExtStr = ".xls": FileFormatNum = 56
        End If

        'Name of the Excel file with a date/time stamp
        XLSFileName = DefPath & "MasterCSV " & _
                      Format(Now, "dd-mmm-yyyy h-mm-ss") & FileExtStr

        'Browse to the folder with CSV files
        Set oApp = CreateObject("Shell.Application")
        Set oFolder = oApp.BrowseForFolder(0, "Select folder with CSV files", 512)
        If Not oFolder Is Nothing Then
            foldername = oFolder.Self.Path
            If Right(foldername, 1) <> "\" Then
                foldername = foldername & "\"
            End If

            'Create the bat file
            Open BatFileName For Output As #1
            Print #1, "Copy " & Chr(34) & foldername & "*.csv" _
                    & Chr(34) & " " & TXTFileName
            Close #1

            'Run the Bat file to collect all data from the CSV files into a TXT file
            ShellAndWait BatFileName, 0
            If Dir(TXTFileName) = "" Then
                MsgBox "There are no csv files in this folder"
                Kill BatFileName
                Exit Sub
            End If

            'Open the TXT file in Excel
            Application.ScreenUpdating = False
            Workbooks.OpenText Filename:=TXTFileName, Origin:=xlWindows, StartRow _
                    :=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
                    ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=True, _
                    Space:=False, Other:=False

            'Save text file as a Excel file
            Set Wb = ActiveWorkbook
            Application.DisplayAlerts = False
            Wb.SaveAs Filename:=XLSFileName, FileFormat:=FileFormatNum
            Application.DisplayAlerts = True

            Wb.Close savechanges:=False
            MsgBox "You find the Excel file here: " & vbNewLine & XLSFileName

            'Delete the bat and text file you temporary used
            Kill BatFileName
            Kill TXTFileName

            Application.ScreenUpdating = True
        End If
    End Sub
    Format or skip columns
    If you want to format or skip a columns then you see you can add FieldInfo in OpenText like
    FieldInfo:=Array(Array(1, 2), Array(3, 4))

    This example change the format of column 1 and 3 (column number, format number)
    This are the format numbers

    1:          General
    2:          Text
    3:          Month-Day-Year
    4:          Day-Month-Year
    5:          Year-Month-Day
    6:          Month-Year-Day
    7:          Day-Year-Month
    8:          Year-Day-Month
    9:          Skip column



    Merge txt files instead of csv files
    Replace

    Print #1, "Copy " & Chr(34) & foldername & "*.csv" _

    With

    Print #1, "Copy " & Chr(34) & foldername & "*.txt" _

    If you use it for txt files then you can change the delimiter or maybe you want to use FixedWidth.
    The best thing you can do is to record a macro when you import one txt file manual.
    Then look at the recorded code and add the code lines to Workbooks.OpenText .



    Merge CSV Files Into One Large CSV File In Windows 7

    If you regularly download CSV files from a database, or receive a number of CSV files containing similar information, you might need to combine all of those files into one larger file. The ability to merge CSV files automatically can be a big time and sanity saver, almost as much as setting a print area in Excel to fix a spreadsheet that isn’t printing well. I recently encountered a situation where I had a large amount of data that was split up into about 100 different CSV files, each of which contained the same number of rows with the same type of data in each row. Each CSV file represented an order from a company, and my company needed to be able to quickly sort all of that data into one file. The combined data could then be organized into a pivot table so that our production team knew how much of each product they needed to make. Your reasons for doing this may vary, but it can be the simplest solution if you need to combine and sort a lot of data. Rather than opening each file individually, then copying and pasting all of the data into one file, you can automate the process with the command prompt. Having witnessed someone manually copy and paste all of the data from multiple CSV files into one CSV file, I know that the ability to merge CSV files is one that can be a huge time saver.
    Step 1:  Move all of the CSV files into one folder. This file does not need to be on your Desktop, but I typically put mine there for the sake of simplicity. Take note of the location, however, as you will need to reference it later. Additionally, once you have finished the merge CSV files process, the output CSV file will also be located in this same folder.
    move all CSV files to one folder
    Step 2:  Click the Start button, click All Programs, click the Accessories folder, then right-click the Command Prompt option and choose Run as Administrator. You can also type “cmd” into the search field at the bottom of the Start menu, which will bring up the command prompt as a search result. You can then right-click the Command Prompt search result, then click Run as Administrator.
    open the command prompt
    Step 3:  Type “cd,” followed by a space, then followed by the folder location, on the first line, then press “Enter.” If you look at the image below, you will see that my folder is called “csv files” and is located on the Desktop of a user that I have called “Demo.” You can also find the folder location by right-clicking the folder, then clicking Properties.
    change the directory to your CSV folder
    Step 4: Type copy *.csv all-groups.csv on the next line, then press Enter on your keyboard. You can change the output file name from “all-groups.csv” to whatever file name you wish. The name that you select in this step is going to be the name of the large file containing all of your merged CSV files.
    Type the code to create the combined CSV file
    Step 5:  Open the folder to see the new file that you just created.
    Open the folder to see your combined CSV file
    Step 6:  Double-click the file to see all of the combined information. In the image below, note that I’ve specified in the third column which file originally contained that line of data. When you merge CSV files, the resulting output file is going to have all of the information organized in this manner, where the data from one file is added after all of the data that has been previously added.
    Open the CSV file



    How to combine multiple CSV files into one using CMD


    • EmailThis is a trick which can save you a lot of time when working with a dataset spread across multiple CSV files. Using a simple CMD command it is possible to combine all the CSV’s into a single entity ready for all your pivot and table wizardry.

    Step 1

    Save all of the CSV files into a single folder. Make sure that the folder is free from any CSV’s you do not want included in the compression.

    Step 2

    Navigate to “Run” from the Windows Start Menu
    • On XP this is located in the Start Menu itself
    • In Vista / Win 7 you may have to navigate first to “Accessories” to find the Run executable.
    Type “cmd” into the executable field and hit Enter.

    Step 3

    When the CMD window opens; you will be presented with your default document folder housing all of your personal files. From here you need to execute the “cd” command which navigates to your desired folder. Type “cd” after the chevron followed by a space then your desired folder location including the drive architecture. For example if your cmd window opens with “C:\Users\Your Name>” pre-populated, the complete command line would read: “C:\Users\Your Name>cd C:Desired Folder”.
    CombineCSV2
    Top Tip – if you navigate to your desired folder in Windows Explorer (e.g. clicking My Documents from the Desktop) you can see the folder location path in the top of the window. However, don’t close it – you cannot copy & paste into CMD so you will need to type the folder path out!

    Step 4

    Once you have entered the command line and hit Enter, the desired folder location will appear on the subsequent line. Now you need to use the “copy” function to merge all the CSV files together. In a similar fashion to the “cd” command, type “copy” after the chevron, followed by a space then “combine.csv”. This copies the data from all CSV files in that location into a single file called ‘combine.csv’.
    CombineCSVfinal
    Top Tip: Because the CSV file format cannot support multiple tabs all of your data will be copied into one worksheet within the CSV workbook. For this reason it may be worth collating all your data in a similar structure – so as to avoid large amounts of formatting work at the end.

    Step 5

    Once executed you will be presented with confirmation; outlining which files have been copied into a single entity. Navigate to your destination folder and enjoy the fruits of your CSV-based labour in combine.csv!