General programming

Moderators: None (Apply to moderate this forum)
Number of threads: 1642
Number of posts: 2791

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
need help with editing dos batch file Posted by ouneeb on 25 Oct 2009 at 9:37 PM
hello there i dont know whwther this the right section to post but i found this more appropriate then others i want to edit the install path of a dos batch file and i dont know the commands i tried to change it but somehow the changes delete data from my drive the actual commands are which i can acess by right clicking on the icon and selecting edit
set CDIR=%CD%\Install Files
set ID=%USERPROFILE%\Games\Unreal Tournament 2004
set TD=%HOMEDRIVE%\UT2004-TMP
i want to change it to d:\games how should i do that and also there is a command line with echo * Game Path: %ID%
kindly help as u guys are quite learned
Report
Re: need help with editing dos batch file Posted by PatrickMc2008 on 16 Nov 2009 at 9:43 AM
You asked so nicely.

So, you want to change "%USERPROFILE%\Games" to "d:\games" in a batch file. Say, this batch file is at C:/install/install.bat.


# Script Games.txt
var str contents
cat "C:/install/install.bat" > $contents
while ( { sen "^"%USERPROFILE%\\Games^" $contents } > 0 )
  sal "^"%USERPROFILE%\\Games^" "d:\\games" $contents > null
echo $contents > "C:/install/install.bat"



Script is in biterscripting ( http://www.biterscripting.com ). Save the script in file C:/Scripts/Games.txt, start biterscripting, enter the following command,

script "C:/Scripts/Games.txt"


That will change "%USERPROFILE%\Games", in every place it occurs in that batch file, to "d:\games".

Change the "C:/install/install.bat" in the script to the correct path of the batch file before trying. Enclose the path in double quotes.


Patrick





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.