need help with adding an item

Discussion in 'Software' started by red death68, Mar 29, 2011.

  1. red death68

    red death68 Command Sergeant Major

    ok so i basicly want to make it so when i right click in a folder or on the desktop and go to new i can create a new batch file. like you can with a text doc and all the other files there any ideas?

    i found the registry key involved and all but i cant get the hex decimal conversion right i found it needs to be exactly 928 bytes and since its a bianary reg entry im having issues with the thing heres a copy of the value of the text doc value from that registry key saved as a .dat file(see attachment as zip file) you can view the contents just right click it and open with notepad at the end youll also notice 5 or so weird y looking characters i believe they may be the key to this but notepad doesnt convert them right i believe
     

    Attached Files:

  2. satrow

    satrow Major Geek Extraordinaire

  3. sach2

    sach2 Major Geek Extraordinaire

    Hi,

    I see just four of the ÿ characters. According to some Ascii charts it is number 255 in the list (others show 255 as no character).

    I'm wondering if it is not the key to finding the correct code but some sort of stop code (end of file code). Years ago 9999 used to be used as some sort of universal end of file (EOF) code. I'm wondering if because it is last in the list if it is used as an EOF code?

    Which registry key are we looking at here? What does the .dat file for new .bmp look like?
     
  4. mjnc

    mjnc MajorGeek

    Character 255 is indeed the last of the 256 characters on the ASCII chart.
    It was referred to as a high order blank, as opposed to 32 which is the normal blank -
    what you get from the Space Bar key.
    I used to use that in batch files to display a blank line in early versions of MS-DOS.
    By holding down the ALT key and typing the number 255 on the NUMERIC keypad immediately after the ECHO command with no preceding space.
    Entering two characters like that produced a blank line on the screen between lines of text.

    The end-of-file character is 26, or 1A in hex.
    In an ASCII text file, you should be able to find the end of the file by looking for the HEX sequence 0D 0A 1A.
    That corresponds to Carriage Return, Line Feed, End-of File.
    The 0D 0A marks the end of a line or just a blank line.

    Don't know if all that means anything in helping you solve this problem.
     
  5. sach2

    sach2 Major Geek Extraordinaire

    Hi mjnc, that is a bit over my head. :-o

    I did find this link that worked for me (Win7) to create a new blank .bat file in the folder. It did not open Notepad for editing but just created an empty .bat file which you were given the option to name as it was being created. Once created you could double-click to open in Notepad for editing. Screenshot attached below.

    So it would be:

    If you read further through the options in that article it looks like you could create a "base" batch file template that you could copy to each new batch file so that if you always started a batch file with specific text you could use a copy of that template file for every new batch file created from the New context menu.
     
    Last edited: Jan 17, 2012
  6. red death68

    red death68 Command Sergeant Major

    thanks guys this is very useful ill see what i can do later i literally just got up at almost 3pm in sick as a dog

    i looked there is no new .bmp option heres a list of whats available: AutoIt v3 Script,Adobe Photoshop Image 12,Briefcase,Microsoft Excel Worksheet,Microsoft Office Publisher Document,Microsoft PowerPoint Presentation,Microsoft Word Document,Text Document,VLC media file (.wav) and then theres a value called: ~reserved~

    hope that helps you
    as for the reg key it is: HKEY_CURRENT_USER\Software\Microsoft\Windows\CureentVersion\Explorer\Discardable\PoastSetup\ShellNew\


    :edit the mothod for adding to right click menu wasnt quite what i was looking for that just sets it to run a batch file or cmd string and it wouldnt appear properly ill contunie looking
     
    Last edited: Mar 29, 2011
  7. sach2

    sach2 Major Geek Extraordinaire

    Sorry you're not feeling well.

    I think the method in reply #5 will work for you. Creating that key should add .bat to the list in the .../Discardable/PostSetup/ShellNew key. My.../Discardable... list now has .bat included. Our lists won't match exactly because they are dependent on installed software. Exported as text file my /Discardable/PostSetup/ShellNew key looks like this:
    Code:
    Key Name:          HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\ShellNew
    Class Name:        <NO CLASS>
    Last Write Time:   3/29/2011 - 5:07 PM
    Value 0
      Name:            Classes
      Type:            REG_MULTI_SZ
      Data:            .accdb
                       .avs
                       .bat
                       .bmp
                       .contact
                       .docx
                       .jnt
                       .library-ms
                       .lnk
                       .pptx
                       .pub
                       .rar
                       .txt
                       .xlsx
                       .zip
                       Briefcase
                       Folder
    
    Value 1
      Name:            ~reserved~
      Type:            REG_BINARY
      Data:            
    00000000   08 00 00 00 00 00 06 00 -                          ........
    
    
    
    or exported to .reg file which I don't understand at all.
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\ShellNew]
    "Classes"=hex(7):2e,00,61,00,63,00,63,00,64,00,62,00,00,00,2e,00,61,00,76,00,\
      73,00,00,00,2e,00,62,00,61,00,74,00,00,00,2e,00,62,00,6d,00,70,00,00,00,2e,\
      00,63,00,6f,00,6e,00,74,00,61,00,63,00,74,00,00,00,2e,00,64,00,6f,00,63,00,\
      78,00,00,00,2e,00,6a,00,6e,00,74,00,00,00,2e,00,6c,00,69,00,62,00,72,00,61,\
      00,72,00,79,00,2d,00,6d,00,73,00,00,00,2e,00,6c,00,6e,00,6b,00,00,00,2e,00,\
      70,00,70,00,74,00,78,00,00,00,2e,00,70,00,75,00,62,00,00,00,2e,00,72,00,61,\
      00,72,00,00,00,2e,00,74,00,78,00,74,00,00,00,2e,00,78,00,6c,00,73,00,78,00,\
      00,00,2e,00,7a,00,69,00,70,00,00,00,42,00,72,00,69,00,65,00,66,00,63,00,61,\
      00,73,00,65,00,00,00,46,00,6f,00,6c,00,64,00,65,00,72,00,00,00,00,00
    "~reserved~"=hex:08,00,00,00,00,00,06,00
     
  8. mjnc

    mjnc MajorGeek

    Hi sach2.

    Funny, I thought this was over MY head. LOL

    Thanks for the links.
    Saved as bookmarks.

    I tryed the same thing by adding NullFile and it worked fine with Windows XP SP3.

    I thought it would be better to have the file created with the usual first line,
    @echo off

    Following the instructions at Add items to the New menu, I added a DATA entry as type REG_BINARY.
    Then Modify the entry to add the string you want to appear in the new file.

    Type in the following, which is the HEX values for @echo off plus the newline and
    carriage return characters which puts a blank line below the first line.
    As you enter the Hex values, the resulting text will be displayed to the right of the entry area.

    40 65 63 68 6F 20 6F 66 66 0D 0A

    You have to Delete the NullFile entry, otherwise the DATA entry will be ignored.

    Thanks again for fining that Ramesh's site link. :cool

    @ red death68
    Sorry you don't feel well.
    Maybe you should get Mum, or a friend, to bring you some homemade Chicken Soup.
    It works like magic. ;)
     
  9. sach2

    sach2 Major Geek Extraordinaire

    Hey mjnc,

    I'm glad you tried the data value. That is on my list to see how that works. It is the "binary" and "hex" that makes my eyes glaze over as soon as I see the words. I have to concentrate on any math type stuff a bit too much for my comfort. (I can get it but I have to concentrate.)

    One day soon, I'll take another look at it. [It is way past time for me to do a fresh install of my OS so I can afford to play around a bit.]

    One more link that looks interesting is here. It sounds like you could get the New sub-menu to work in such a way as to have an entry on the list that would create a new batch file and open it in Notepad to edit it--all in one step. I'm definitely going to look at that one to see if it is possible. The original way works just like all the other entries in the New sub-menu but I'm curious if it Notepad could be launched automatically for editing the new file. We shall see...before my fresh install.
     
  10. mjnc

    mjnc MajorGeek

    Yeah, me too, but actually it was fairly easy.

    The Hex values are easy to get by either using the ASCII chart that you linked to,
    or by using a text editor that shows the Hex values.
    I use PSPad version: 4.5.4 (2356) which is the current Stable release.
    If you have a file loaded in the edit window, part of the status bar shows the following at the current Cursor Position:

    • Character itself (if it is a printable character).
    • Character's ASCII value in decimal.
    • Character's ASCII value in hexadecimal.

    I'll check out the other thing you linked to at a later time.
     
  11. red death68

    red death68 Command Sergeant Major

    ok i tryed sach's method and it worked perfect apperently the first method mentioned by sat didnt quite work right for me but this works perfect

    btw i am feeling alot better a z-pack sleep and some scripting does wonders lol
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds