Results 1 to 6 of 6

Thread: How to rename .Bat-append fixed text in c#

  1. #1
    Join Date
    Jun 2011
    Posts
    414

    How to rename .Bat-append fixed text in c#

    I was searching for the batch file but I dint get anything. Well I had created very much simple batch file which usually sign the android .apk and which will going to create the output .apk what I’m trying is to use the original file name as the base file that will going to sign the file name. Can anyone tell me to how to do this I had search many things for it but dint get anything. Can anyone suggest me how to do this? Thanks in advanced.

  2. #2
    Join Date
    May 2009
    Posts
    527

    Re: How to rename .Bat-append fixed text in c#

    I think you are just trying to create the file for say Test.apk which should become Test_signed.apk. I have something for this but it would be able to process only one file at a time.
    Code:
    @ECHO OFF
    :: Title & Description Of Batch File.
    ECHO ApkSigner v0.1                    +
    ECHO Andy Harney 2011                  +
    ECHO Sign Your Customized APK +
    ECHO +++++++++++++++++++++++++++++++++++
    ECHO.
    ECHO.
    ECHO IMPORTANT
    ECHO ---------
    ECHO.
    ECHO make sure that you only have one apk to be sign inside the folder 
    :: PAUSE adds "hid any key to conti…."
    PAUSE
    ECHO.
    :: Confirmation Of Output Filename.
    ECHO your apk is signed and it is named as APK.APK .
    :: LOCATION OF YOUR FILE
    "C:\Program Files (x86)\Java1\jdk1.6.0_25\bin\java.exe" -jar .\Files\signapk.jar .\Files\testkey.x509.pem .\Files\testkey.pk8 .\INPUT\*.apk .\SIGNED\ APK.apk
    ECHO.
    :: CONFIRMED FOR SIGNING
    ECHO Done, 
    ECHO.
    PAUSE
    EXIT

  3. #3
    Join Date
    Apr 2009
    Posts
    488

    Re: How to rename .Bat-append fixed text in c#

    You can easily do that in the command script but for that you need a advanced command that should be added in the NT and even the later version of the windows. And if you are willing to use for command then you must make a use of for? And you will get a help page and you must see the token option also. And if you’re planning to rename the file then you must go into directory where the file is usually located and you can even save the current directory then make a use of PUSHD and after that return by using the POPD.

  4. #4
    Join Date
    May 2009
    Posts
    539

    Re: How to rename .Bat-append fixed text in c#

    Well as far as I know for command will only going to read into the file and then extract the data. But I don’t think so this is what you are looking for. You can easily read the file and then stored the variable and then call that variable and then append that variable and what you trying can be easily done with the batch file. If you are not getting it then make a search for the sample code and I’m sure it will be very much useful for you to get it done.

  5. #5
    Join Date
    Mar 2010
    Posts
    154

    Re: How to rename .Bat-append fixed text in c#

    Other than for command you can make a use of switch to perform the task line by line depends on the contents of your file. And it can even count up and down between two numbers. And it will also going to check the sub directory that will going to perform the tasks in the individual files. While it will also provide the file handling option by extracting only the name of the file. I think for command can also do this you must try both to get your work done.

  6. #6
    Join Date
    May 2009
    Posts
    529

    Re: How to rename .Bat-append fixed text in c#

    You can try the below code as it work with all the .apk files in the directory and after that just change the name according to it and you can easily integrate it in your script. You can easily use the single .apk file which may sign the directory for once.
    Code:
    @echo off
    for %%B in (*.apk) 
    do (CHANGE %%A %%~Nb_apk.apk
    )
    In this N will only going to extract the filename of the %%A

Similar Threads

  1. Trouble with simplying a fixed cost/fixed duration project plan
    By stewart AFTS in forum Microsoft Project
    Replies: 3
    Last Post: 20-02-2012, 08:02 PM
  2. How to append data to a text file in java?
    By KALANI84 in forum Software Development
    Replies: 4
    Last Post: 05-02-2010, 04:44 PM
  3. Append text to end of file
    By New ID in forum Software Development
    Replies: 5
    Last Post: 18-01-2010, 09:35 AM
  4. Split long text into fixed width with Powershell
    By Dyumani in forum Windows Software
    Replies: 3
    Last Post: 10-06-2009, 06:24 PM
  5. cannot rename any text file
    By akki22m in forum Customize Desktop
    Replies: 5
    Last Post: 22-11-2008, 03:02 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,986,504.89714 seconds with 17 queries