Vbscript to copy user defined number of row in new file

Discussion in 'Visual Basic ( VB )' started by punit, Apr 11, 2010.

Thread Status:
Not open for further replies.
  1. punit

    punit New Member

    Joined:
    Apr 11, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Plese please please,
    can anybody modify the above script, to read user define no of rows, and copy that row into new text file with same name as source file on same location where source file is present
    i m using following syntex to run the above mention script from command line (windows),
    cscript "file location\script.vbs" (Above script)
    which is working perfectly fine,
    But what i want is, with above syntex now i will enter No.of raw which i wants to read, and please dont make this script hard code i.e i have to change name of source.file in to the script. which also i want user will pass with .vbs script, so the final syntex that i will enter in command line (windows)is as follows;
    cscript "Script_location\Script.vbs" "File_location\File_Name.txt" "Row_count"
    Where:-
    "Script_location\Script.vbs" = Our script.vbs location
    "File_location\File_Name.txt" = source file which user wants to read
    "Row_Count" = No of row of source.txt which user wants to read

    After running above line in command line the new text file which is created by the script which contain only user specified no. of rows on the same loacation where source file is present.
    ya and 1 last thing is, while running above script it should not give any popup on screen, new script should do its work quitly.
    Please i want this thing urgently, as i m new with vbscripting and i m not able to write vbscript on my own, need help please.......
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice