Partially Usage of RedirectSection

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Well - depending on the security of the wincmd.ini and it's location. You could do:
ATTRIB -R "%ProgramFiles%\TotalCMD\Data\wincmd.ini"
REM GSAR file changes
ATTRIB +R "%ProgramFiles%\TotalCMD\Data\wincmd.ini"

OR Perhaps,
gsar -i -s"ShowHiddenSystem=1" -r"
ShowHiddenSystem=0" "%ProgramFiles%\TotalCMD\Data\wincmd.ini" "%ProgramFiles%\TotalCMD\Data\wincmd2.ini"
REM ...
ATTRIB +R +H "%ProgramFiles%\TotalCMD\Data\wincmd2.ini"
:_RetryMoveWincmd
MOVE /Y "%ProgramFiles%\TotalCMD\Data\wincmd2.ini" "%ProgramFiles%\TotalCMD\Data\wincmd.ini"
IF EXIST "%ProgramFiles%\TotalCMD\Data\wincmd2.ini" GOTO:_RetryMoveWincmd
The IF Exist may/may not be necessary, a possible extra-precaution if the file was unable to move the first try - if wincmd.ini was locked?
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

Balderstrom,
ATTRIB -R "%ProgramFiles%\TotalCMD\Data\wincmd.ini"
REM GSAR file changes
REM Execute TC
REM Reset GSAR file changes
ATTRIB +R "%ProgramFiles%\TotalCMD\Data\wincmd.ini"
If default value is set according to users' one, this procedure may be helpfull.

EDITED >>> In fact, I don't need ATTRIB function, because I have write permission
EDITED AGAIN >>> This procedure may fail when the another user run TC at a moment just after "GSAR file changes"

Thanks and Regards
Post Reply