Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

winrar sfx comment.txt through batch file

- - - - -

  • Please log in to reply
5 replies to this topic

#1
darksimoon

darksimoon

    Member

  • Member
  • PipPip
  • 111 posts
  • Joined 29-May 05
hello friends;
i am preparing winrar sfx file as portable application through batch file.
and i enter the options of the sfx file by comment.txt
but when i enter "TempMode" into the comment.txt by batch file,
somehow it doesn't extract the files into the temp file. Instead it extracts
the files into the current folder. I don't understand why.
below is my batch.cmd and comment.txt content;
how can i make the sfx file to extract the content into the temp folder ?

=========batch file=========
echo TempMode >> .\comment.txt
============================

=====comment.txt===========
;Created By Alberto
setup=FSCapture.exe
TempMode
Silent=2
Overwrite=1
===========================


As an alternative to this problem i decided to use "path=%temp%" instead of "TempMode".
but this time batch file converts "path=%temp%" to "path=C:\Users\alberto\AppData\Local\Temp"
in the comment.txt

=========batch file=========
echo path=%temp% >> .\comment.txt
============================

=======comment.txt=========
;Created By Alberto
setup=FSCapture.exe
path=C:\Users\myuser\AppData\Local\Temp
Silent=2
Overwrite=1
===========================
how can i make the batch file to write "path=%temp%" in to the comment.txt ?

That is to say, how can i solve TempMode issue at sfx file or path=%temp% issue at batch file ?
please help me about them.
best regards....
Darksimoon


How to remove advertisement from MSFN

#2
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,593 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
Open a command prompt.
Try issuing in it:
@echo %temp%

@echo ^%temp^%

jaclaz

#3
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,546 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

The usual method of escaping percent characters in batch files is by doubling them up!
>OUTFILE.EXT ECHO=%%TEMP%%


#4
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,593 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

The usual method of escaping percent characters in batch files is by doubling them up!

>OUTFILE.EXT ECHO=%%TEMP%%

Yes :thumbup
It is different between command line and batch, my bad :blushing: .

jaclaz

#5
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,338 posts
  • Joined 14-September 05
  • OS:none specified
  • Country: Country Flag
What OS are you running this on?

What version of WinRar? (see Version History / OS supported)

Winrar v4 Help

Edited by submix8c, 05 September 2012 - 11:35 AM.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#6
darksimoon

darksimoon

    Member

  • Member
  • PipPip
  • 111 posts
  • Joined 29-May 05
dear Jaclaz; thank you very much for your help
dear Yzöwl; i did as you say and it worked out. :) thanks a lot.
and dear submix8c; i use both win xp and win 7. i also use the latest version of winrar. however there is no such a thing in the help file.
so i think best way is set the path=%temp%.

once again, thank you very much friends.
Darksimoon




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users