Hey guys,
does anyone know some of the basic commands for editing .txt files and an example. I cant seem to find any on Google other than echo, and i ned some for a project im working on.
Thanks!
if you're using linux, just use vi. if you're on windows, download vim for windows.
alongenemylines said:
if you're using linux, just use vi. if you're on windows, download vim for windows.
Click to expand...
Click to collapse
is there any way of doing this natively on a windows machine?
mbarvian said:
is there any way of doing this natively on a windows machine?
Click to expand...
Click to collapse
Are you talking Windows or Windows Mobile? If standard plain windows then Notepad should work just fine. It's included in all windows versions.
pananza said:
Are you talking Windows or Windows Mobile? If standard plain windows then Notepad should work just fine. It's included in all windows versions.
Click to expand...
Click to collapse
I'm talking about windows, and is there a command line usage for notepad?
What exactly are you trying to do? You can start notepad.exe from the command line, but that's about it I think. If you want to automate search/replace, save, insert etc you'll have to find another tool.
pananza said:
What exactly are you trying to do? You can start notepad.exe from the command line, but that's about it I think. If you want to automate search/replace, save, insert etc you'll have to find another tool.
Click to expand...
Click to collapse
to be specific: I am trying to create a batch file that I plan on using daily that replaces a line in a .txt file with a particular line I want, and I'd rather not use notepad because I have this batch file set on startup
OK, now I understand what you want.....
Have a look at SFK (Swiss File Knife ) see here
or FR (File Replace) see here
Both are freeware, neither are "native" to Windows, but either should - with a bit of trial and error - get you to where you wanna be
HTH,
Mark.
mbarvian said:
to be specific: I am trying to create a batch file that I plan on using daily that replaces a line in a .txt file with a particular line I want, and I'd rather not use notepad because I have this batch file set on startup
Click to expand...
Click to collapse
I don't think thats possible... but why don't you use mortscript, maybe that works (they have a pc version), otherwise M$ has a new version out of an application that should replace the bat language...just can't recall the name...
-=Google Time=-
PowerShell
If that also fails I could write you a small exe which should be able to do what you want it.....
Related
Hi, there is a huge interest in other communities about what you are doing in here. I can say only one word, unbelieveable.
I have a few questions,
1- has anyone tried to do the same using any other Pocket PC?
2- is there any thoughts about to create a version of mkrom for Windows (I believe that the current one is for Linux)?
TIA
Hello!
I have very interested in mkrom version for windows too....
Hark0
[www.klonycs.net]
P.S. Frank, please email-me if you have more info about this topic.
Ehm, Windows as in the 95/98/ME/2000/XP family of desktop Operating Systems does not run from ROM, it runs from disk. It does not have persistent RAM, and as such does not have a cold-boot vs. warm-boot, unless you count OS installation as a cold-boot.
You can modify properties of the installation procedure using installation scripting, and you can 'freeze' an install you like by creating an 'image backup' of the drive it's installed on.
Duh! The above shows how dense I can be. Ofcourse you mean running mkrom on Windows instead of unix, not running mkrom for Windows.
You should be able to run it on Windows already, if you install the ActiveState perl environment and mess with it little.
I'm thinking maybe we should offer an environment through a perl script and samba or ftp right here... Hmmm...
Yes we were talking about to run the mkrom on windows.
What you are saying about the Perl enviroment could be a solution but I'm not really familiar with that. Could be simplest to recompile or create a version of mkrom for Windows (to run on windows)?
I know you are busy guys but I think you have not understood the magnitude of what you have done. Right now you can find 1000s of users willing to modify the ROM of there PPCs, no matter what kind of PPC they have. So please... think with a wider perspective.
I have a few things I have tried in my page www.pc-counselor.com/e740rom.htm and as you can see there, in the case of a Toshiba e700 series is very easy to get a copy of the rom and put it back. A lot easier than in HP devices.
That was me in the previous message, I did not notice I was not logged. Sorry
XDA developer Itsme said:
a windows box with http://www.cygwin.com/ unix tools will do too.
make sure you select perl and bash in the cygwin setup tool.
Click to expand...
Click to collapse
Keep in mind that for those who are not familiar with Linux and perl, etc all these instructions sound like chinise.
:lol:
You could also use a CD-ROM version of Knoppix.
No hassle to install Unix, just boot from CD and make one of your HD partitions write-enable.
I think I managed to create a rom image with MKROM on windows, and since I've never done anythign like this before, I thought I'd try to explain the process I followed so that other unskilled user like me could do it as well.
to all you advanced user, please feel free correct this if it is wrong.
1. MKROM
Download the MKROM distribution archive from http://www.xda-developers.com/mkrom/
… read the page while you’re there!!
Unzip mkrom.zip somewhere easy to find (not on your desktop, because your desktop is not easy to find in a DOS/UNIX window, I would suggest c:\mkrom\)
2. O2 ROM
Also download the Radio Unit Upgrade from:
http://www.sourceo2.com/O2_Developers/Launched_devices/O2_xda/default.htm
Once downloaded right click on Radio_Unit_Upgrade_v31703.exe and select “winzip/open with winzip” (if you don’t have winzip, download the demo at http://www.winzip.com)
In Winzip Locate the the file nk.nbf and extract it to your c:\mkrom\ folder (be careful, by default winzip will create a folder called “English” and put nt.nbf it in that folder. You don’t want that! It should just be in the c:\mkrom folder)
3. install CYGWIN
MKROM needs to be run UNIX or Linux (don't know which) by default but you can apparently run it on windows by using one of these:
• Activestate (http://www.activestate.com/)
• Knoppix (http://www.knopper.net/knoppix/index-en.html)
• CYGWIN (http://www.cygwin.com)
I tried CYGWIN
• Download setup.exe from http://www.cygwin.com
And run it. (this is a small software that allows you to chooses which bits you want to download and install)
• I selected “install from the internet” but you can also download first then install from the local drive.
• on the next screen I left all the default as they were. I don’t know whether DOS or UNIX text file type is better here, so I just left the default: UNIX.
• On the next screen select a FTP server from the list.
• Now you’re presented with a list of packages to download. By default, you won’t get all the necessary ones (the ones for the PERL scripts).
I didn’t know which particular package was needed so I’ve just selected the whole DEVEL section. ( to do that, click on the DEFAULT next to DEVEL and it will change to INSTALL.
If someone could tell us which particular packages are actually necessary, this would cut down on the 100Mb download
The rest can stay as is.
This will download then install, nice and clean!
4. runnig MKROM
Double click the CYGWIN icon and this will open a “DOS” window (I know it’s not DOS, but it looks like it)
You will see a prompt with
Code:
[email protected] ~
$
type in :
Code:
cd c:\mkrom
or whatever you’ve saved it to (now you see why it’s better to keep it simple)
the XDA-Developers have included a README in mkrom.zip which specifies you then need to type in:
Code:
chmod +x tounicode
then you’re ready to go:
type the following:
Code:
bash mkrom.sh nk.nbf
let it run for a while, (it took a bit over a minute on my P700Mhz)
when you see the prompt again, you’ve done it!
As described in http://www.xda-developers.com/mkrom/ you now have 2 files in c:\mkrom\out\
xdaromimg-1.nb1
xdaromimg-1.nbf
I think the file xdaromimg-1.nbf is the same as the nk.nbf that’s in jeff’ release.
http://cuba.calyx.nl/~jsummers/XDA/XDA-developers-SER-v11.exe
It’s exactly the same size, but I don’t know how to check whether they are exactly the same files.
the next step is to rename your xdaromimg-1.nbf to nk.nbf and replace the one that's in XDA-developers-SER-v11.exe with your new one. (do this still using winzip) save it and run the exe.
!!!!!I haven't tried to flash my XDA!!!!! but I just I'd share my experience with you, please tell me if I've got all of this right.
Ben Darras
is this right
XDA- developers, Jeff, anyone else,
Could you confirm that this procedure is correct, before we start shooting ourselves in the foot! :shock:
Regards
Alex
Does cygwin have perl installed by default?
Jeff did something else we recommended, which is take the files needed for EzWAP from a machine with the O2 ROM installed, and copy them to one of the files directories of the new ROM.
But EzWAP is quite large, so if you never use WAP you could copy other stuff there that more suits your needs.
Otherwise, the above procedure looks correct at first sight. Mind you we use a Linux box, and we have no experience doing this under Windows.
We recommend all people that burn ROMs they built themselves have an PC SD-card writer have experience using 'XDArit', so they can always use the bootloader method to get back to where they were. Flashing the .nb1 file using 'XDArit' and an SD card is marginally safer, since using 'Programme A' could overwrite your bootloader if something went really, really wrong.
Once you have established a new ROM will get the unit back up to the point where it connects via ActiveSync, others can flash it without too much danger. But if you want to avoid all danger and be completely on the safe side then do not make your own ROMs...
Thanks for the answer, Peter Poelman
Does cygwin have perl installed by default?
Click to expand...
Click to collapse
no it doesn't, I suggested...
...By default, you won’t get all the necessary ones (the ones for the PERL scripts).
I didn’t know which particular package was needed so I’ve just selected the whole DEVEL section. ( to do that, click on the DEFAULT next to DEVEL and it will change to INSTALL.
If someone could tell us which particular packages are actually necessary, this would cut down on the 100Mb download
Click to expand...
Click to collapse
Thanks for the additional info and the warning.
I love what you guys are doing here!
Ben
Jeff did something else we recommended, which is take the files needed for EzWAP from a machine with the O2 ROM installed, and copy them to one of the files directories of the new ROM.
But EzWAP is quite large, so if you never use WAP you could copy other stuff there that more suits your needs.
Click to expand...
Click to collapse
I'm using the NK.nbf that came from Jeff's download. this is the one that has ezwap files in it? If so can i download o2 rom update from there website and use it to build a custom rom? i don't need ezwap on my ppc and rather use it for something else. is my logic correct?
thanks
alex
kalex said:
I'm using the NK.nbf that came from Jeff's download. this is the one that has ezwap files in it? If so can i download o2 rom update from there website and use it to build a custom rom? i don't need ezwap on my ppc and rather use it for something else. is my logic correct?
Click to expand...
Click to collapse
Correct. You can download mkrom like it is now, not add the EzWAP files, and you'd have more space for your own stuff in there.
If you want to check that two files are identical, try the unix 'diff' command (which should have been installed with cygwin)
I'm looking for a command line decompression utility for WM6.x platform. Unzip/unrar/uncab anything could be OK.
Anybody knows if such utility available?
tomal said:
I'm looking for a command line decompression utility for WM6.x platform. Unzip/unrar/uncab anything could be OK.
Anybody knows if such utility available?
Click to expand...
Click to collapse
idk if it can do EVERYTHING you want but try mortscript, it has built in winzip support and you can add winrar support to it also.
gzip, zip are easy to be implemented in .Net CF. Maybe will work for CAB also... for RAR no ideas.
you need this for scripting or to integrate in an application ? if it's for application you may find components available on the net, for scripts mortscript looks to be a good direction to look at...
I believe pocketrar (made by the winrar guys) does cmd line as well as gui.
Da_G said:
I believe pocketrar (made by the winrar guys) does cmd line as well as gui.
Click to expand...
Click to collapse
nice to know... thanks for the tip, will test it tomorrow (here is almost midnight) but should be nice to make my device downloading RAR files and uncompress them automatically (just need to automate rapidshare now lol *private joke*)
Thanx mate.
I'll try all of them. pocketrar should be nice if that really works for silent unpack.
The idea behind is: I want to integrate it into the kitchen process.
A list of files/packages will be packed during rom build and they will be unpacked only at first call/run of the associated application. But the unpack process should be silent and command line decompression is the best deal in my opinion....
I need some help with a batch file. I am going to run the batch file on a usb flash drive/thumb stick. What I need it to do is copy three files from the usb flash drive/thumb stick to a directory on a computer. The three files are drivers. A Netgear N150 WNA1100 drivers to be exact. I have been looking around different websites but they have been no help to me.
No help?
Sent from my rooted Pantech Burst running Gizmolord V4.0 RC7
Code:
@xcopy "%~dps0\driver_blah_blah" "dest_drive:\path\"
e.mote said:
Code:
@xcopy "%~dps0\driver_blah_blah" "dest_drive:\path\"
Click to expand...
Click to collapse
Actually, xcopy has been depreciated in favor of robocopy.
--------------
Usage :: ROBOCOPY source destination [file [file]...] [options]
source :: Source Directory (drive:\path or \\server\share\path).
destination :: Destination Dir (drive:\path or \\server\share\path).
file :: File(s) to copy (names/wildcards: default is "*.*").
:
: Copy options :
:
/S :: copy Subdirectories, but not empty ones.
/E :: copy subdirectories, including Empty ones.
/LEV:n :: only copy the top n LEVels of the source directory tree.
/Z :: copy files in restartable mode.
/B :: copy files in Backup mode.
/ZB :: use restartable mode; if access denied use Backup mode.
You can get these by opening a command prompt and typing robocopy /?
Robocopy isn't present on all Win boxes. There are still a lot of XP boxes out there. Xcopy isn't as robust, but for copying a few driver files from USB, it doesn't need to be.
I assumed OP is informed enough to know basic copying syntax. His difficulty is with the USB drive letter, which is dynamically assigned by default. The %~dps0 is what he's looking for. Syntax to this is in an unlikely place, for /?.
Speaking of deprecating, *.* wildcard has been out of fashion since the DOS days.
e.mote said:
Robocopy isn't present on all Win boxes. There are still a lot of XP boxes out there. Xcopy isn't as robust, but for copying a few driver files from USB, it doesn't need to be.
I assumed OP is informed enough to know basic copying syntax. His difficulty is with the USB drive letter, which is dynamically assigned by default. The %~dps0 is what he's looking for. Syntax to this is in an unlikely place, for /?.
Speaking of deprecating, *.* wildcard has been out of fashion since the DOS days.
Click to expand...
Click to collapse
Oh, well, it is a Windows 8 Forum, so I figured he was asking for this OS. I haven't tried xcopy on my Windows 8 machine, but it still works on Windows 7.
Speaking of color: Personally, I like to change the screen color when performing long copy commands, so that I know how far along the CMD file has progressed.
The OP does not have to worry about the drive letter if he is running the cmd file off of the thumb drive (which is my assumption). all he needs is to provide the name as the source; it will assume the drive letter and current directory. If he is trying to use it from the computer, that could be a problem.
EDIT: Sorry about the color comments. I was picking up the text colors in the quote box! (but I still like to color my screens on long cmd files).
EDIT again: As far as the *.* goes, I was simply pasting the result of the robocopy help command. You'll have to write MS about that one!
thanks e.mote I needed to write the batch file because my dad works for my ISP and he has to install the wireless USB adapter manually due to microsoft saying that any program not on the marketplace is illegal to install or run. I will make his time and install easier.
Edit: The batch file is gonna be used on multiple machines. So drive letters are way out of the question.
Edit 2: It is only gonna be run on windows 8 machines.
nightfire37 said:
thanks e.mote I needed to write the batch file because my dad works for my ISP and he has to install the wireless USB adapter manually due to microsoft saying that any program not on the marketplace is illegal to install or run.
Click to expand...
Click to collapse
That is completely false. Windows 8 will allow installation of any software, not just store software. Only windows RT restricts software installs and your drivers on a USB will not function on windows RT due to it being an ARM device and the drivers being for x86. And why use a batch file to copy another file, isnt that what Control-C and Control-V are for
SixSixSevenSeven said:
That is completely false. Windows 8 will allow installation of any software, not just store software. Only windows RT restricts software installs and your drivers on a USB will not function on windows RT due to it being an ARM device and the drivers being for x86. And why use a batch file to copy another file, isnt that what Control-C and Control-V are for
Click to expand...
Click to collapse
My dad wanted to me to come up with a solution to make the job easier and so i did and the guys that supposed to be helping the guys in the field that do this kind of stuff arent helping at all and inside the corporation, there are people that can barely know how to open up emails, let alone run an app but they cannot install or look onto the Local Disk because they will get lost and not understand it. i fully understand the differences of RT and the x86 versions of Windows 8. The machines my dad works on are x86 based. I did mess around with it and i was not happy at all with the changes Microsoft has done to it. I will never understand Microsoft's move to make there OS a touch screen based computer when almost every single computer that OEMs sell do not have touch screens. I'm getting off topic but anyways thanks for telling me this guys.
Frankly, if you're just copying a couple of files whose names you know, and they aren't directories and don't need special attributes applied, you may as well just use the old "copy" command. As in,
copy thefile1.sys, thefile2.inf, thefile3.cab C:\thedestfolder\
You can make it a bit more specific if you want to handle things like the case where the file already exists, or the destination folder does not... but the basic form is very simple. For help, you can use
copy /?
but dont you still need to worry about the drive letters?
Sent from my Samsung Galaxy Player 5.0 USA running CM10 using xda app-developers app
copy "%~dp0CHANGEME1.ext" "%~dp0CHANGEME2.ext" "%~dp0CHANGEME3.ext" "%SYSTEMDRIVE%\path\to\folder\on\host\OS\drive\"
This only works from a batch file (It will produce erratic results if ran from a plain command prompt), and you can test what it will send as paramaters by putting an 'echo' before the 'copy'. It will use absolute paths to the files in the same dir as the batch script, in case the working directory is not as expected (such as if it is ran as admin).
Here is the output on my system:
C:\Users\Nathan\Desktop\test>test.bat
copy "C:\Users\Nathan\Desktop\test\CHANGEME1.ext" "C:\Users\Nathan\Desktop\test\CHANGEME2.ext" "C:\Users\Nathan\Desktop\test\CHANGEME3.ext" "C:\path\to\folder\on\host\OS\drive\"
nightfire37 said:
but dont you still need to worry about the drive letters?
Sent from my Samsung Galaxy Player 5.0 USA running CM10 using xda app-developers app
Click to expand...
Click to collapse
If you put the batch file in the same directory as the drivers, you can simply run it from there, providing only the file name as the first argument, and the target drive (should always be C:\Windows\System32 - or whatever).
copy AAAAAA.dll C:\Windows\System32
copy BBBBBB.dll C:\Windows\System32
copy CCCCCC.dll C:\Windows\System32
xcopy and robocopy are really meant for copying large numbers of files.
EDIT: The former post is correct, using %SYSTEMDRIVE%\Windows\System32 would always find the system drive, even if it were not the C: drive. But I suspect the vast majority of computers are using C: as the system drive.
stevedebi said:
If you put the batch file in the same directory as the drivers, you can simply run it from there, providing only the file name as the first argument, and the target drive (should always be C:\Windows\System32 - or whatever).
copy AAAAAA.dll C:\Windows\System32
copy BBBBBB.dll C:\Windows\System32
copy CCCCCC.dll C:\Windows\System32
xcopy and robocopy are really meant for copying large numbers of files.
EDIT: The former post is correct, using %SYSTEMDRIVE%\Windows\System32 would always find the system drive, even if it were not the C: drive. But I suspect the vast majority of computers are using C: as the system drive.
Click to expand...
Click to collapse
If you right-click on a .bat and run as admin it will change the current dir to System32, so your method won't work unless the user has UAC disabled/is an admin, or if they do some horrific permissions changes to System32 to allow it to run as a non-admin.
There are other instances where the logged dir isn't the same as the calling script, eg when you drag-drop files onto the script to be processed. Granted it's not the case here, but it's good practice to assume as little as possible for Win shell scripting (which survived mostly untouched from DOS). There are enough quirks in it to already drive you crazy.
Speaking of quirks, I prefer %~dps0 (or simply %~fs0) over %~dp0 because the console buffer can be exceeded in case of really long path names, which results in an error. The 's' switches to the old 8.3 short-name format and obviates this problem. It also avoids the problem of pathnames with UTF-8 characters, which some Win versions can't recognize (I'm not sure about Win7, but Win8 can handle UTF-8 in the console fine). File/pathname is the most common issue in Win shell scripting. Always use double-quotes to enclose them.
netham45 said:
If you right-click on a .bat and run as admin it will change the current dir to System32, so your method won't work unless the user has UAC disabled/is an admin, or if they do some horrific permissions changes to System32 to allow it to run as a non-admin.
Click to expand...
Click to collapse
Most of my batch files use full paths, so I would not know. I just opened a cmd window as administrator, and it does go to system32. I never noticed that before.
I think then the best way to run would be to do a search for cmd (from the start menu), run it as administrator, and then change to the drive containing the batch file. From there it would execute.
Or try the other method described above.
thanks guys for this information. its much appreciated.
Sent from my Samsung Galaxy Player 5.0 USA running CM10 using xda app-developers app
Most of us often want to add custom functionality to an existing apk and know how to do it in java, but don't know the exact dex/smali syntax. Trying to add this, there, test, error, debug, fix & hopefully getting it to work is common. To solve all of that trouble, I bring you this.
I made these little scripts to add an extension to Windows explorer shell for doing a task most people couldn't just do this easy. So now can just write your functionality in java, right-click the file & click Convert To *.smali and tada! You have the dex/smali compatible code which you can then paste it into your apk smali file.
Installation:
Download the attachment & extract the archive.
Run install.cmd as Administrator to install Windows Explorer shortcut.
You can also darg-n-drop files on convert.cmd to convert them.
Nice bro :thumsup:
Thank you very much. This is exactly what I need
Thanks for the information..
I would like you to help me with this issue since I do not want to work the conversion
it not work
where is the converted smali jfile?
Hello.
I click the right button of mouse and click the Convert to*.smali.
But I didn't the converted file.
could you lend me a hand?
vaibhavpandeyvpz said:
Most of us often want to add custom functionality to an existing apk and know how to do it in java, but don't know the exact dex/smali syntax. Trying to add this, there, test, error, debug, fix & hopefully getting it to work is common. To solve all of that trouble, I bring you this.
I made these little scripts to add an extension to Windows explorer shell for doing a task most people couldn't just do this easy. So now can just write your functionality in java, right-click the file & click Convert To *.smali and tada! You have the dex/smali compatible code which you can then paste it into your apk smali file.
Installation:
Download the attachment & extract the archive.
Run install.cmd as Administrator to install Windows Explorer shortcut.
You can also darg-n-drop files on convert.cmd to convert them.
Click to expand...
Click to collapse
Can you please update this. I tried running it on windows 10 and after that I don’t see the right click convert to smali
It's not working on Windows 10....Any updates on it?
Dear All
Can I run Windows 10 PC Apps that are already deployed in Program Files\WindowsApps\? I can't find any exe file. I wonder which one is executable file?
Yes you can run, Right-click the app you want and click Properties. Click the Compatibility tab. Check the Run this program in compatibility mode option.
Rexkh said:
Dear All
Can I run Windows 10 PC Apps that are already deployed in Program Files\WindowsApps\? I can't find any exe file. I wonder which one is executable file?
Click to expand...
Click to collapse
You can use DISM tool from Windows to do that, just Google a bit to know how!