writing batch files in windows 7


  1. Posts : 21
    Windows 7 Ultimate x64
       #1

    writing batch files in windows 7


    Greetings
    the following simple one line batch file used to run in Windows XP

    fsort.bat
    sort %1 /o %~ns.%~x

    fsort list.txt would sort the text file list.txt and put the result in lists.txt
    now it doesn't run.
    it seems that windows 7 doesn't handle parameters like %~n and %~x
    What do I do instead?
    Where can I find the do's and do not's of batch file in windows 7?
    (in xp I used the help. now when I search for batch I get nonsense)
    please help
      My Computer


  2. Posts : 1,965
    win 7 X64 Ultimate SP1
       #2

    Some Help


    To start with I will supply an MS link to commands.

    Bcdboot

    I don't think that is exactly what you are looking for but it will be useful. I will keep looking.
      My Computer


  3. Posts : 1,965
    win 7 X64 Ultimate SP1
       #3

    Another Link


    Here is another link and some advice.

    Windows 7 : Understanding Batch File Basics (part 2) - Using Batch File Parameters - Microsoft Certification Examples, exercises, practises, tutorials, solutions about Windows

    In your web search type "Win 7 command line syntax". You will get copious amounts of good links. If I had to read or hunt a lot for the command parameters, I would hunt the syntax and commands for the "power shell" included in windows.
      My Computer

  4.   My Computer


  5. Posts : 21
    Windows 7 Ultimate x64
    Thread Starter
       #5

    Thank you Hammerhead
    I was not familiar with this page.
    I read it and as you can see under the for command the subvariables %~n and %~x are still in use, thanks God.
    That gave me an idea to corrcet my simple one liner fsort.bat file.
    here's the final working (!) version of fsort.bat
    sort %1 /o %~n1s.%~x1
      My Computer


  6. Posts : 21
    Windows 7 Ultimate x64
    Thread Starter
       #6

    HammerHead said:
    Here is another link and some advice.

    Windows 7 : Understanding Batch File Basics (part 2) - Using Batch File Parameters - Microsoft Certification Examples, exercises, practises, tutorials, solutions about Windows

    In your web search type "Win 7 command line syntax". You will get copious amounts of good links. If I had to read or hunt a lot for the command parameters, I would hunt the syntax and commands for the "power shell" included in windows.
    This page is a bit too elementary for me. I also saw part3. but I wan't familiar with this site either, so thanks again.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:36.
Find Us