Use Runtime Util in Windows 98

I want to launch an external application via my Java program. I use following codes in Windows NT and it works fine.
String command = "cmd /c type sample.txt > copyOfSample.txt";
Runtime.getRuntime.exec(command);
When I move to Windows 98, I tried the same code. It doesn't work. Then I tried command = "command /c type sample.txt > copyOfSample.txt". It still doesn't work. If I typed the same command at dos prompt, it works fine.
Can any one help me out? Thanks a lot.

The example I use is a simple example. But the real case I have is using a special compiler to compile a file and then write the compile result into another file.
The file to be compile is dynamically decided. How to put this kind of command into a batch file? Could you give an example?
"javac c:\dir\test.java > c:\dir\result"
Thanks.

Similar Messages

  • Viewing disk partitions made using Disk Utility in Windows

    So, I took a USB external hard drive and partitioned it into two volumes using Disk Utility. I made sure to format them in MS-DOS format so they are FAT16 and can be recognized by Windows. I then took the hard drive and plugged it into my Windows computer. The first partition showed up just fine in my F: drive, but I'm not sure where the second partition is. When I plug it into my Mac, both volumes appear on my Desktop, but only the first one shows up in the Computer folder of my Windows computer.
    Any help would be appreciated.

    What does it look like in Windows Disk Management?
    Click Start (if you're on XP then click run) and type "diskmgmt.msc" without the quotes (on XP click OK, anything after XP click on the program), then in the bottom window (where it says Disk 0 Basic disk etc) find your external drive, what do the partitions look like?
    It might be that windows isn't mounting that partition for some reason.

  • Unable to start Tomcat using runtime class in windows 98

    hi,
    I am using a runtime class which calls a batch file, that calls statup.bat for starting tomcat.
    This works perfectly in windows NT,2k. But on win 98, the tomcat window opens and closes within no sometime.
    In my class i call the first batch file starter.bat using
    Runtime.getRuntime().exec("%COMSPEC% /c start e:/starter.bat");
    (I tried with command.com also...)
    Starter.bat has the line
    call E:\jakarta-tomcat4.1\bin\startup.bat.
    Is there anyother way to start the tomcat process and keep it running on windows 98. Anyone with anyclues pls help.
    Thanks in advance.

    This is the Runtime class i am using... Sometimes tomcat gets closed and sometimes just hangs... (putting it in for better understanding..)
    public class Starter {
         public static void main(String[] args) {
              String com = "%COMSPEC% /c start
    C:\\PACS\\SFAApp\\tomcat\\startup.bat";
                   try     {               
                        Runtime rt = Runtime.getRuntime();
                        Process pr = rt.exec (com);//Starting tomcat
                        try
                             pr.waitFor();     
                        catch (Exception e)
                             e.printStackTrace();
                   catch (IOException ie) {
                        System.out.println("IOException caught" + ie);
                        ie.printStackTrace();

  • Using OCOPY utility in Windows

    Dear Sirs:
    I have setup a Oracle 10G RAC in VMware where the two guest operating systems are Windows 2003.
    The VOTING DISK, DATABASE DISK, and the OCR DISK are as /device/Hardisk1/Partition1, /device/Harddisk2/Partition1, and /device/Harddisk3/Partition1
    respectively. These are all virtual devices.
    Now when I query the V$Controlfile view for locations I am getting result as:
    NAME
    +DATA/rac/controlfile/Controlfile123456.7889
    +DATA/rac/controlfile/Controlfile16361.737982
    If I am using " C:> OCOPY \\.\PHYSICALDRIVE2 C:\ " the whole ASM drive (that is disk2) is getting copied.
    If I mention " C:> OCOPY \\.\+DATA\rac\controlfile\Controlfile123456.7889 C:\" the utility says that input file not found. I am making lot of permutations
    and combinations for the input file path such as back slash to front slash, getting rid of the + sign before DATA etc etc, but no useful result.
    I know that using OCOPY for backup is never the best practice. RMAN should be used. But my problem is that I want to learn OCOPY learn the concepts of
    ASM, RAC.
    Please let me know that if I want to take manual backup of specific files (data file, control file, log file) then how should I use OCOPY?
    Even if I want to use RMAN for specific files only then what is the command.
    I am extremely new to RAC. Thanks in advance
    Best regards,
    Caesar

    hi User, Welcome to forum.
    DBMS_FILE_TRANSFER copies files on the same Oracle server or between two Oracle servers. It uses directory objects to specify the source and destination directories and, because directory objects support ASM pathnames, so does DBMS_FILE_TRANSFER. This makes it an easy way to move files to and from ASM storage from a regular filesystem.
    for more information, refer the link: how to copy?
    http://www.builderau.com.au/program/oracle/soa/Copy-Oracle-s-Automatic-Storage-Management-files-with-DBMS-FILE-TRANSFER/0,339028441,339280831,00.htm

  • Issue regarding creating a process using Runtime in Windows 2003.

    Hi all..
    I need to resolve a small issue related to execute an external program using runtime execution method. But when i deploy the code in websphere application server 6.1V in windows 2003 server operating system, it is starting a process with min priority and not executing even i specified waitfor method.
    The code is like below.
    try{
    Process p = Runtime.getRuntime().exec("C:\\CopyImages.exe "+toWrite);
    int ep = p.waitFor();
    System.out.println("process "+ep);
    catch(Exception e)
    e.printStackTrace();
    Please help me in resolving this issue. The above code is working in my IDE which is in Window XP but when i port it in application server in windows2003 i'm getting this issue.

    hi..
    it is a typo error. i've given the slashes with that.
    but still getting the problem.

  • Resized partition using Disk Utility and now Windows 7 will not boot

    Hi,
    Hopefully someone can help me!!
    I had previously used Boot Camp to install Windows 7. However, I later realised I had not given myself anywhere near enough disk space as I started using Windows for things I hadn't originally planned on using it for.
    Anyway, long story short, to solve the problem I uninstalled some applications on my Mac OSX and used Disk Utility to decrease the size of my Mac partition. My plan was then to reboot to Windows and use a Windows application to increase the size of the Windows partition. However - I coudln't even get that far.
    Upon decreasing the size of my Mac partition (succesfully) I restarted my Mac in order to boot to Windows. However, I was greeted with a message along the lines of "unable to boot to Windows please insert boot disk and press any key" (I can't remember the exact message).
    I was wondering if anyone knows of any way to restore my Windows partition, retaining all of my previously saved files on my Windows disk. It's probably a long shot, but the thought of losing everything I have been working on for the last few months is a sickening one.
    What does give me a bit of hope is that, if I click Boot Camp it seems to recognise that Windows 7 is installed as the option that appears is to uninstall it.
    Furthermore, if I view partitions in Disk Utility, a "DISK0S4" is listed. However, it's only at 20gb - if this WAS my BootCamp partition previously, it was originally at something around 60gb (I think - either way, definitely bigger than 20gb!).
    On top of this, my current Macintosh HD parition is at 260gb and with the DISK0S4 partition at 20.21gb, there seems to be some space missing... I'm hoping this is the files I've been working on over the last few months!
    Anyway, I've done some searching on the net and it *seems* that GPT fdisk *might* be my savour. I've downloaded it but have no idea how to use it and don't plan on playing about with it as I could no doubt do some real damage. If it is likely to solve my problem however, I'm certainly more than capable of being walked through what I need to do.
    Please help!

    Hi Christopher,
    I also have problems with Windows rebooting after partition resize trying to reduce Mac side and increase Windows side. I do not see the BootCamp partition labelled as such while running disk utility. The Windows partition shows up when I boot up while pressing the ALT key. However, when I try to run Windows, it says " error loading operatig system".
    I also followed instruction and went through to run gdisk successfully. Results towards the end.
    What can be done? Windows still does not boot and It shows ? Suspicious MBR at sector 0.
    Below is information based on typical questions you ask.
    diskutil list
    /dev/disk0   #:                       TYPE NAME                    SIZE        IDENTIFIER
       0:              GUID_partition_scheme                        *120.0 GB     disk0
       1:                                           EFI                         209.7 MB     disk0s1
       2:                         Apple_HFS Macintosh HD            78.5 GB     disk0s2
       3:                       Apple_Boot Recovery HD             650.0 MB     disk0s3
       4:                   Microsoft Basic Data                         31.7 GB      disk0s4  
    sudo gpt -r -vv show disk0
    gpt show: disk0: mediasize=120034123776; sectorsize=512; blocks=234441648
    gpt show: disk0: Suspicious MBR at sector 0
    gpt show: disk0: Pri GPT at sector 1
    gpt show: disk0: Sec GPT at sector 234441647
          start       size            index       contents
              0          1                             MBR
              1          1                             Pri GPT header
              2         32                            Pri GPT table
             34          6        
             40     409600           1            GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
         409640  153240016      2            GPT part - 48465300-0000-11AA-AA11-00306543ECAC
      153649656    1269544     3            GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
      154919200   17628896        
      172548096   61892608    4            GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
      234440704        911        
      234441615         32                       Sec GPT table
      234441647          1                        Sec GPT header
    sudo fdisk /dev/disk0
    Disk: /dev/disk0 geometry: 14593/255/63 [234441648 sectors]Signature: 0xAA55
             Starting       Ending
    #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
    1: EE    0   0   2 - 1023 254  63 [         1 -  172548095] <Unknown ID>
    *2: 07 1023 254  63 - 1023 254  63 [ 172548096 -   61892608] HPFS/QNX/AUX
    3: 00    0   0   0 -    0   0   0 [         0 -          0] unused     
    4: 00    0   0   0 -    0   0   0 [         0 -          0] unused  
    sudo gdisk /dev/disk0
    GPT fdisk (gdisk) version 0.8.7
    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Partition table scan:
      MBR: hybrid
      BSD: not present
      APM: not present
      GPT: present
    Found valid GPT with hybrid MBR; using GPT.
    Command (? for help): r
    Recovery/transformation command (? for help): h
    WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
    just hit the Enter key at the below prompt and your MBR partition table will
    be untouched.
    Type from one to three GPT partition numbers, separated by spaces, to be
    added to the hybrid MBR, in sequence: 4
    Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y
    Creating entry for GPT partition #4 (MBR partition #2)
    Enter an MBR hex code (default 07):
    Set the bootable flag? (Y/N): y
    Unused partition space(s) found. Use one to protect more partitions? (Y/N): n
    Recovery/transformation command (? for help): o
    Disk size is 234441648 sectors (111.8 GiB)
    MBR disk identifier: "DELETED INFO"
    MBR partitions:
    Number  Boot  Start Sector   End Sector   Status      Code
       1                               1    172548095   primary     0xEE
       2           *     172548096    234440703   primary     0x07
    Recovery/transformation command (? for help): w
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    Do you want to proceed? (Y/N): y
    OK; writing new GUID partition table (GPT) to /dev/disk2.
    Warning: Devices opened with shared lock will not have their
    partition table automatically reloaded!
    Warning: The kernel may continue to use old or deleted partitions.
    You should reboot or remove the drive.
    The operation has completed successfully.

  • My mac mountain lion dont boot , and dont repair using disk utility what should i do i have so important data on it .my window partation work perfact

    hi ,]
    last n8
    i partatioon hard disk and install windows 7 using bootr cam ,
    nw wt heppen my mac HD partation dnt start jst gray screen with apple logo appear and then some loading bar heppen and then shurt down
    i tried to repair partation using disk utility
    bt
    cant repaird ..
    so wht should i deoo..
    my all data are on mac ..i have to back up .
    how can i

    There is no option for "DVD and CD Sharing" on a 2011 Mini because it doesn't have an optical drive to share. That option is available only on computers with an optical drive to share.
    That option is used, on the other "donor" computer with an optical drive that you want to use/share. On the other computer you turn on "DVD and CD Sharing", allowing its optical drive to be shared. Then on the Mini you connect to it with "remote disc".
    I believe you're thinking about the "DVD and CD Sharing" System preference in reverse; you activate it on the computer whose optical drive you want to use/share, not on the Mini without an optical drive.
    See the following which explains how to set up and use remote disc: http://support.apple.com/kb/HT1777?viewlocale=en_US

  • Problems erasing window bootcamp partion using Disk Utility

    Hi guys, ive removed my windows partion before in the past without any hiccups, but this time i seem to have run into some problems.
    If i go into boot camp assistant, it wont let me proceed beyond the start menu. When i click continue it says
    "The startup disk cannot be partitioned or restored to a single partition.
    Back up the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) volume. Restore your information to the disk and try using Boot Camp Assistant again."
    So i went into Disk utility to erase the Windows partion, only now i get this message
    "Volume Erase failed
    Volume Erase failed with the error:
    MediaKit reports checksum operation failure."
    I dont have any other programs such as diskwarrior, and in the past Disk utilitiy served me well. Im just wondering whats going on here, and if anyone is able to help fix this problem? Thanks in advance

    Hi thanks for your help man, but i still cant get it to restore the partion. If i go into the partion tab i see my two partions under the Volume scheme... but i cant do anything as it is all greyed out. Would you or anyone else have any recommendations... or should i invest in Diskwarrior? at the moment disk utility is just not working out for me. Thanks

  • Using Runtime.getRuntime().exec(DOS Program) with Windows 2000.

    I am trying to spawn a DOS Program from within Java.
    On Win95/98/ME, I use
    Process     p = Runtime.getRuntime().exec("START /w command.com con /c myDOSProgram.exe");
    This works on these platforms. On Win 2000, I use
    Process     p = Runtime.getRuntime().exec("START /w cmd.exe con /c myDOSProgram.exe");
    It does not work at all.
    I have tried all combinations of using START, cmd.exe, con /c, etc.
    I can spawn a Windows App using
    Process     p = Runtime.getRuntime().exec("windows.exe");
    And it works fine.
    What does it take to spawn a DOS program from Java on the Windows 2000 op sys?

    Hi. I recently wrote a java GUI that calls a DOS program with mixed success. Here's the code I used to make the call:String osName = System.getProperty("os.name" );
    String[] cmd = new String[4];
    if( osName.equals( "Windows 2000" ) || osName.equals( "Windows NT" ) )
         cmd[0] = "cmd.exe";
         cmd[1] = "/C" ;
         cmd[2] = "VBDoc.exe";
         cmd[3] = fileName;
    else if( osName.equals( "Windows 95" ) || osName.equals( "Windows 98" ) )
         cmd[0] = "command.com" ;
         cmd[1] = "/C" ;
         cmd[2] = "VBDoc.exe";
         cmd[3] = fileName;
    else
         System.out.println(osName);
    Process proc = runtime.exec(cmd);Check out this article, it gives a good explanation of how to use the exec() call:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Hope this helps!

  • I erased my windows partition using disk utility then realized I should have used boot camp, because now I can't resize the original partition and seem to be stuck with a ghost unusable space. Boot Camp now doesn't give me the option to install or re

    I erased my windows partition using disk utility then realized I should have used boot camp, because now I can't resize the original partition and seem to be stuck with a ghost unusable space. Boot Camp now doesn't give me the option to install or remove windows partition.

    Hi, Ralph,
    The problem is that I did erase the partition, using disk utility, but I can't go back to my original disk size pre-partition, as disk utility won't let me do it and gives the message "Couldn’t modify partition map because file system verification failed." When I try to use Boot Camp Assistant it won't let me select the third option to remove windows.

  • Using Disk Utility to burn cd's but not compatible with PC Windows

    I'm using disk utility to back up files/photos. I use disk utility because I need to append the cd with multiple burning sessions. My problem is that the burned disc will not read in Windows PC environment.
    Any ideas?
    Thanks

    You are correct. Discs burned with Disk Utility (single or multi-session) are not Windows compatible.
    The only way to burn Windows compatible discs with OS X is via the Finder.
    Other utilities, like Toast, will easily make Windows compatible discs.

  • Reformat external hard drive for Windows machine using disk utility

    I have a Maxtor 160GB dual-interface external HD. I used it for my Mac OS X. I erased and reformated the hard drive on my Mac to MS-DOS using Disk Utility for use on my fathers Windows XP. I hooked the hard drive up to the Windows machine and the hard drive was visible in both Windows Explorer and on the task bar. I right clicked on the hard drive and selected Format. The formatting takes a while but at the end an error appears indicating the hard drive was not formattable. How can I get a MS-DOS formatted hard drive (from a Mac) to be used on a Windows XP machine with a NTFS format?

    Turns out it is possible:
    Maxtor Support..
    I would use your Disk Management utility within Windows to repartition and reformat the drive. To access Disk Management, right click on My Computer, go to Manage, and then choose Disk Management. Within Disk Management the drive should show in your list of disks (Disk 0,1,2 etc etc). I would delete any partitions that are on the drive. To delete a partition, just right-click on the partition and choose delete. Make sure you’re deleting the correct drive. Once the entire drive says unallocated then the drive should be ready to partition and format. Just right click within the Unallocated Space on the drive and choose the New Partition or New Volume option to set up the drive.
    I followed the instructions and everything worked.

  • What format for my external drive allows use with Mac and Windows?

    I got an external hard disk (1 tr) and i want to used it for my windows and mac, i read i can have two partitions one for mac and one for windows, but i dont really want to have two parts, and I read i can format it by fat32 and i can write and read on both os, is that true?
    I want to use it for movies, os backups, and files..
    Is it true that i can only save files up to 4 GB when the format is fat32?
    please advise..

    It this case you would need to to go to "Disk Utility" on mac and select 3 partions which will be under the Parition Layout in my screen shot below. "Current" is grayed out that will drop down select 3 partitions and make one NTFS, second Mac OS Extended, third FAT32. Using the FAT32 for both Mac and Windows but the files have to be under 4GB each.

  • I recently purchase macbook air with OS 10.10.2. I want to use my Seagate external backup plus hard drive for time machine back up. How to partition my 1TB Seagate back up plus hard drive for use with mac and windows pc?

    Hi All,
    I recently purchased 13" Macbook Air with OS 10.10.2. I want to use my 1TB Seagate backup plus external hard drive as time machine and my windows 7 pc. Please suggest a method. Thanks in advance for your reply.

    I strongly recommend having an external drive dedicated solely for TimeMachine. You could partition the drive but if something goes wrong you risk losing the data on both partitions. Should you decide to go ahead with splitting the drive for two different uses you’ll need to partition the drive either using the Mac’s built in Disk Utility program or Windows utility. I believe the built in Windows disk utility program will destroy the current partition and erase the data that’s on it - I use a third party Windows disk utility program for partitioning and it allows for non-destructive partitioning but warns to back up data first just in case. Apple’s Disk Utility can do non-destructive partitions but I don’t recall every trying to do a non-destructive partition on a disk originally formatted for Windows using it. Again - back up that data just in case.
    Finally, your TimeMachine drive should be at least 1.5 times (I prefer 2 times) the size of the data you expect to be backing up a year or two from now.  In other words, if you currently are using 50GB of your computer’s drive but expect to begin purchasing Mac software to replace software on your Windows computer and if you expect to be putting photos, music, and other data on it you might expect that two years from now you’ll have 100GB of stuff on the drive. So a 200GB partition is the smallest size you’d want.  TM’s backup scheme keeps multiple copies of data as it changes so the extra room is important for this scheme.

  • How to set up roaming profile on Macs using AD like in windows

    I can bind the workstations to the domain fine.. But can someone direct me to instructions of how to set up the roaming profiles ?
    What steps do I need on the server ? This is what I've done so far.
    I already have OU's for the departments and the users have a shared folder inside their department folder.... \\server\shared_folder\user
    I have done the usual things with AD as far as the profile settings on the windows server.
    Am currently running Mac OS 10.5 and above
    My windows AD runs on windows server 2008
    All my windows workstation are able to use roaming profile without a problem.
    So far i have tried the so many avenues including..
    Make sure the Mac systems are joined to the domain controller and an ADS user can log on successfully. Use "Directory Utility" under "Utilities" menu to join the system to the domain.
    Backup all the contents from /Users to the storage or somewhere locally.
    Configure automount - Go to "Utilities" -> "Directory Utility" - Select the domain and click "Show advanced options" - Click "Mounts" tab and add automount as mentioned below. Remote NFS URL: nfs://server_name/share_name/path/to/profile/directory Mount location: /Users Additional mount parameters: -P,-T Apply the settings and this will mount the remote shared folder or we can name it as Roaming Profile Space - under /Users directory
    Enable roaming profile - Go to "Utilities" -> "Directory Utility" - Select the domain and click "Show advanced options" - Click "Services" -> Select "Active Directory" and click "Show advanced option" - Click "User experience" tab and select the option "Create mobile account at login".
    Reboot the system and log in as any ADS user. The Roaming shared folder will be mounted and the user profile will be created on the shared folder
    Can anyone kindly assist me

    Hi Guys, anyone with the Soln...or Tips..Am waiting

Maybe you are looking for

  • Will creating a new apple id delete all my music?

    So i recently discovered that the email I have been using for my apple id has been hacked, so I am thinking about creating a new apple id. My question is will creating a new apple id cause me to lose all the music on my itunes? I cannot sign back ont

  • Export failing

    I've been trying to export 2320 photographs. It manages to export 652 of them and then gives the error message: Unable to create /Volumes/.... Giving the directory I'm exporting to. I've tried making it a simple directory name, I've tried deleting th

  • All files on Boot Camp partition mysteriously erased after 10.5.3 update

    My wife's MBP 2.4 was running 10.5.2 with a Boot Camp installation of Windows XP. The other night she upgraded to 10.5.3 and everything on her Boot Camp partition was erased somehow. She spent most of the day working in Windows. During the day someon

  • HP Photosmart 6180 Wireless Scanning Problems Leopard

    Aaaarrrgghhhhh, I feel like pulling my hair out! I have the above mentioned all in one HP device and since upgrading to leopard i'm having countless problems scanning. I'm using the latest HP driver (ver 9.7.1) but the HP Photosmart Studio keeps cras

  • Canon ir5185 printers and EFI Command Workstation

    Hi, We have three Canon 5185 color printers and are working with CWS 5.0.0.94. The previous version worked functioned fine with almost no problems. For some reason my CWS (Mac version) is constantly dropping connection with my 3 5185's and it's funct