ripken204 Posted January 5, 2007 Posted January 5, 2007 (edited) i am trying to run a batch file to open something on the e:/ drive, but the cmd give this error "e:/programs is not recognized as an internal or external commandedit:i think the problem is just when im trying run something from the E:\Programs(x86) directoryedit again:ok i am right, and i need quotes-> E:\"Programs(x86)"\Java\jdk1.6.0\bin\java.exe Accountthat works. but the problem i have now it that im using textpad to write my java programs and it automatically makes a batch file with no qutoes to run the .class file, so does anyone know how to tell textpad to use quotes? or is there a directory i can set?"E:\Programs(x86)\Java\jdk1.6.0\bin\java.exe" Accountthis also works.. Edited January 5, 2007 by ripken204
Netman66 Posted January 5, 2007 Posted January 5, 2007 At first glance it looks like your backslash is actually a forward slash. (e:/ is incorrect, e:\ is correct).If not, please post the code.
ripken204 Posted January 5, 2007 Author Posted January 5, 2007 oh that was just a mistake, no coding problem there, this is all a textpad/cmd problem
Netman66 Posted January 5, 2007 Posted January 5, 2007 You could use 8-dot-3 names:E:\Progra~1\Java\jdk1.6.0\bin\java.exe Account
ripken204 Posted January 5, 2007 Author Posted January 5, 2007 (edited) well the thing is that i need to find a way to have textpad do this automatically for me, i dont want to have to change code each time i go to compile and run a file.edit:well the only way i can make this works is to install java to c:/java for now. i just really wish there was a solution to this problem.. Edited January 5, 2007 by ripken204
gunsmokingman Posted January 5, 2007 Posted January 5, 2007 I do not know if this will help you but here is a VBS script.What this script does is run a loop that collects all the hard drives on the local computer then it checks for the path to the exe.Save As StartJava.vbsDim Act : Set Act = CreateObject("Wscript.Shell") Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject") Dim Java : Java = "\Programs(x86)\Java\jdk1.6.0\bin\java.exe" Dim Drv, StrD Set Drv = Fso.Drives For Each StrD In Drv If StrD.DriveType = 2 Then If Fso.FileExists(StrD & Java) Then Act.Run(Chr(34) & StrD & Java & " Account" & Chr(34)),1,True End If End If Next
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now