Problems using cmd.exe in a script

What I'm trying to do is this. I have this program called
zoomify.exe on the server. (check out zoomify.com, its a cool image
magnification program). What I want to do is run a command like
this in cmd.exe:
D:\zoomify.exe D:\temp\image.jpg
If I was to run this inthe command prompt window on the
server it would create a folder within D:\temp named "Image" with
all the output files from the zoomify.exe. The program also works
so that if you drag and drop an image onto the exe in windows
explorer it does the same thing.
So I have this custom tag cfx_exec on the server and I have
it pull up a command prompt, enter in the parameters including
chr(13) and chr(10) to simulate hitting enter and then I throw
"Exit" at it as well to close the command prompt window. It acts as
though it runs no problem but it never actually creates the new
folder and image collection.
I know it is not a permission thing, coldfusion is run under
the domain administrator account and has full permission to execute
things like this. For example I use the same custom tag to run NET
USER commands to change active directory passwords and things of
this nature.
Can anyone suggest what I may be doing wrong here?

Figured it out...it was in the syntax...had to use single quotes around table and field names. Don't use Access much...Live and Learn Baby!

Similar Messages

  • Using cmd.exe

    I'm trying to use the robocopy from cmd. I installed this in the /windows/system32 I run this command in the cmd robocopy: C:\\sigpad\\default "C:\\sigpad\\something here" /s
    and it works fine I try this command in java and it puts the exact same output but it does nothing. Any ideas?
    String command = "cmd.exe /c robocopy C:\\sigpad\\default \"C:\\sigpad\\" + kiol + "\" /s";
    System.out.println("cmd.exe /c robocopy C:\\sigpad\\default \"C:\\sigpad\\" + kiol + "\" /s");
    Process process = Runtime.getRuntime().exec(command);

    You need to read the 4 sections of [http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html|http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html] and implement the recommendations. If you are still having problems then you need to post your updated code together with the output from the process stdout and stderr.

  • Problem with cmd.exe  /C SET

    Hi:
    I am trying to set environment variables for an exe file in a Java program.
    I am thinking to do:
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(cmd.exe /C set FILEDIR=c:\temp);
    But, I tried cmd.exe /C set FILEDIR=c:\temp on my xp machine dos window and in the java code. The FILEDIR is null.
    Does someone have any idea what went wrong? Anyother better ways to set environment variables in java codes?
    Thanks.

    cmd.exe opens a new command process. The set command will only be effective in this particular process. As soon as the process closes (which will be immediately the set command completes) the value of FILEDIR will be lost.
    You can see this by doing cmd /K set FILEDIR=c:\temp. This will leave the command process open and you see what the value of FILEDIR is.

  • CREATING TUTORIALS PAGES USING CMD.EXE AS THE VIEWER.

    Hello all.
    I apologize in advance if this question comes off as ignorant to any of you but, I'm pretty new at scripting..,
    having a lot of fun with it so i'm barreling ahead!
    I've been combining all the hundreds of tutorials text files that I have been gathering over time, trying to get them in order
    and finally create something like html help pages yet using the command line as the viewer. this would be exactly like what one would see after entering "/?". the help section of someones exe program. my problem is I do not know how or what to
    place in the tutorial.cmd script in order for command line to display the pages one window at a time automatically so that the viewer/user does not have to enter the " | more " command, he/she is then only required to tap a key to go onto the next
    portion of the pages.
    Any help is appreciated thank you!

    Try "more"
    At a prompt type "more /?"
    ¯\_(ツ)_/¯

  • HELP! Problem using HPSCAN.exe or TWAIN driver for HP Laserjet Pro cm1415fnw using Windows 7

    I have been using the HP Laserjet Pro cm1415fnw for over a year without a problem.  At the time when I first purchased the unit, I was using a Dell desktop with Windows XP and connected the printer via USB port.  I was able to print and scan from my computer, including from within applications that use TWAIN scanning driver such as Word, Acrobat, etc.
    I have since upgraded to an HP slimline s5-1160 computer using Windows 7.  I installed the Laserjet software from my installation CD's without a problem.  The printer is connected to the computer by USB port.  I can continue to print without a problem.  However, I no longer am able to scan using the HP software (HPscan.exe) nor from within applications that use TWAIN scanning driver such as Word, Acrobat, etc.  When I attempt to do so, it takes a long time before it asks me what TWAIN scan driver to select.  When I select the HP cm1410 MFP series, the program either crashes or reverts to the state it was before I attempted to scan an image into a document from within the program.
    I can however scan successfully using the Windows Scan and Fax wizard or if I choose "Devices and Printers" from the Start Menu and select "Start scan" from the menu after right-clicking the HP printer icon.  However this option limits my use of the scanner -- I cannot scan to a PDF nor can I scan multiple pages into an OCR application.  I'm forced to scan to either a JPG or TIF or PNG.
    As for attempting to resolve this problem I have done the following with no success:
    Uninstall and reinstall the full software and drivers (and using the most recent version on the HP website)
    Change USB ports and/or cables
    Run the HP scan diagnostic utility, which seems to show an error at the WIA scanning step and then recommends that I uuninstall and reinstall the full software.  When I skip that and allow it to check for TWAIN scanning, it gives me a similar error, suggesting that I use the most recent version of the drivers (the driver that I am using is v 3.0 dated 11/12/2009)  Therefore in this case the HP scan diagnostic utility does NOT provide a fix for this problem other than uninstall and reinstall, which I have done several times to no avail
    Contact HP support both for the computer and the multifunction printer (which as I understand are different support staff).  The printer staff claims it's a software problem and that the computer staff should be able to resolve it (something about not having "launchpad" installed properly.  When I contact the computer staff, they claim it's a printer driver issue.  So I am at a standstill
    I researched the HP support forums only to find from this link - http://h10025.www1.hp.com/ewfrf/wc/document?docnam​e=c02661093&cc=us&dlc=en&lc=en&product=4089468&tmp​... - that if you cannot scan from HP software that you can use the programs that rely on WIA drivers (Windows Fax and Scan) which I already know I can do but implies that HP does NOT have a solution for how to scan using their own software!
    My gut tells me that this is one of those problems that many others may have but for which there is no workable solution.  It's possible that during the course of uninstalling and reinstalling the software, remnants may remain behind that prevent proper functioning of the drivers, but without knowing how to specifically "clean" those remnants before reinstalling the software, I am at a loss.  Oh and by the way, I've also tried using CCleaner and Norton Registry Cleaner in an attempt to clean those remnants, but that effort didn't help.  
    My question is basically this... does anyone know of a fix around this problem or must I resign myself to using the Windows Fax and Scan wizard to scan in documents and images and forget about using TWAIN programs as HP seems to be suggesting?  I would think that given that I am using an HP printer/scanner along with an HP computer with Windows 7 that this problem should NOT be a problem!  
    This question was solved.
    View Solution.

    Before attempting to install the printer on my computer (HP slimline s5-1160), I had been able to successfully install the printer previously on two other computers: a Lenovo T-410 laptop (work computer using Windows XP) and an HP Pavilion Elite HPE (wife's computer using Windows 7).
    On those computers, I can use the TWAIN driver from within applications without a problem, and the HPSCAN.exe file works as well.  Both computers connect to the printer wirelessly.
    It is while trying to install the printer on my home computer via USB that I am having all sorts of difficulty. I have also tried to connect my s5-1160 to the printer wirelessly from my computer. I also checked the Windows Services, and all seems fine there.  I also tried switching USB ports and cables.   Again, no luck with the scanning using TWAIN driver. 
    One other point: when I use the original installation CD that came with the printer to install on the s5-1160, the installation seems to stop when it says "Checking requirements for installation"  That didn't happen with the two other computers.   However, that problem doesn't happen the s5-1160 when I used the more recent version of the full software from the HP website.
    Let me reiterate.  I have never had any problems with printing from any computer.  The scanner works fine from my s5-1160 if I resort to using the scanner and fax wizard using the WIA drivers.  What I am unable to do is to get the scanner to work from within an application using the TWAIN driver or if I use the native HP application (hpscan.exe).  Nothing seems to happen.   Because of that I cannot scan directly into a PDF.
    And the only fix that the HP scan diagnostic utility continues to recommend is that I uninstall and reinstall the software.  It shows errors in the WIA scanning step and TWAIN step.
    Is it possible that because of behind-the-scenes Windows updates that my s5-1160 is receiving that a software conflict is created that prevents the TWAIN driver from functioning properly?  Other than that I am at a loss to figure out why this is happening.

  • Problem using jsp:forward in java script

    hi,
    when I use jsp forward tag inside java script i'm getting a problem that
    when the jsp is invoked it is getting forwarded to the page specified in the forward tag, without checking the if conditions. Following code may give you a better idea.
    <html>
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    <jsp:forward page="success.jsp" />
    </script>
    <body>
    <form name="f" method=post>
    <input type=text name=htemp value="true">
    <input type=button onclick="test()">
    </form>
    </body>
    </html>
    please help me,thanks inadvance
    regards
    chandu

    What pgeuens means is that you can't mix javascript and jsp/java code in this way.
    ALL of the jsp/java code gets executed at the server end.
    This produces an HTML page (with embedded javascript) which gets sent to the client.
    The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
    So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
    If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
    <%
    if (testCondition){
    %>
      <jsp:forward>
    %<
    %>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    document.f1.action="success.jsp";
    document.f.submit();
    </script>You cannot run JSP code based on your javascript code.
    Java. Javascript. Not the same thing.
    Hope this helps,
    evnafets

  • Problem using ant 1.6.2 scripts for weblogic 8.1

    hai,
    i downloaded ant 1.6.2 and started writting ant scripts. these ran fine when i am doing jobs related to websphere application server but they are failing when i am running the same targets in weblogic.
    i know that this problem is mainly due to the old version of inbuilt ant provided by the weblogic.
    i use import,input,condition tasks in my code and when ever run the ant scripts in weblogic its saying that these targets can not be found.
    i am in great need for help, any one please help me how to make these newer version of ant scripts to work in weblogic.i have no choice but to use these tasks as the design requires using them.
    i will be greatly indebted to the replier as i am wasting lot of time for this.

    Hello,
    I could not find an easy way to get the wls version of ant to start using the tasks you mention from ant 1.6.2.
    I tried defining the tasks using taskdef and also adding them to wls ant.jar and updating the deafult.properties file but the ant complained about unexpected elements in the build.xml file where I added the new tags (e.g import)
    If your really up against it you can try adding wls tasks to ant 1.6.2, they are listed here:
    http://e-docs.bea.com/wls/docs81/toolstable/ToolsTable.html#1009580
    Although I could not located exactly which jar they are in. Good luck.
    Cheers
    Hussein Badakhchani
    www.orbism.com

  • Redirecting output from 'cmd.exe /c'

    I am using Powershell 2009 on a WIN-Server 2008 R2
    I have seen several suggestions on how to "redirect" the output generated by a 'cmd.exe /c', but none of the suggested solutions were successful.
    I have a simple cmd
    cmd.exe /c my_program.cmd $file.basename
    This process creates a lot of screen output and this command is in a loop of all files in a directory.
    I want to capture the output to a file "$lgfile"
    I have used
    {content}
    >> $lgfile
    {content}
    Out-file -filepath $lgfile [no output]
    {content}
    `$lgfile 2`>>`&1 [error '&" is reserved for future use]
    I would be grateful for any suggestions
    Also, the reason I am using "cmd.exe /c" is because that is the only method i have been able to use successfully (my_program.cmd is calling an ORACLE compiler! and all other methods to execute this compiler did not work except as a cmd-file)

    I usually just pipe to Set-Content:
    cmd.exe /c my_program.cmd $file.basename | Set-Content $lgfile
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Error when running a script using upsshell.exe

    I have a simple custom script which is
    Sub Test1()
    Set fso=  CreateObject("Scripting.filesystemobject")
    Set ts = fso.CreateTextFile("D:\DATA\****\Outbox\Templates\Test.txt")
    ts.writeline "hi"
    End sub
    When I am running it manually in workbench, the script runs fine but when I try to run it using upsshell.exe(command provided below)
    D:\Oracle\MIDDLE~1\EPMSYS~1\products\FINANC~2\SHARED~1\upsShell.exe CustomScriptEx=****~admin~****~~****~D:\DATA\test\Outbox\Logs~Test1~1033~0
    i get the following error
      ERROR:
        Code............ 438
        Description..... [Script failure caused error]: Object doesn't support this property or method
        Procedure....... modupsShell.ExecuteCustomScriptEx
        Component....... upsShell
        Version......... 1112
        Process ID...... 292496
        Thread.......... 290292
      IDENTIFICATION:
        User............ admin
        Domain..........
        Computer Name... *******
        App Name........ ****
      PROCEDURE STEPS:
        1-Split Arguments
        2-Create Load balancer=*******
        3-Authenticate
        4-Get Next App Server
        5-Open App Server=*******
        6-Execute the script=Test1
        7-Step was not reached, a previous step failed
    Any ideas on the error?

    Hello Verdulken,
    I have a few additional questions:
    Does your application function correctly when running the LabVIEW operator interface you have created as a VI in the LabVIEW development environment (i.e. does this problem only occur when the LabVIEW operator interface is run as an executable)?
    What is the error that you are receiving?
    Regarding the VI that you open programmatically, do you open it in a visible manner (i.e. use the Show front panel when called option from VI Properties)?If so, do you also close this VI after it finishes (i.e. use the Close if originally closed option from VI Properties)?
    Does the error occur on the step that calls this very same VI again later in the sequence?
    Does your application function correctly if you use the development adapter for all of your calls?
    Thank you in advance for this information,
    Matt G.
    National Instruments
    Applications Engineering

  • Stop weblogic services using StartStopServices.xml parameter leaves cmd.exe

    When using the "Start > All Programs > Oracle Business Intelligence > Stop BI services" function it calls the StartStopServices.cmd file. This file then references the StartStopServices.xml file using the following statement;
    <target name="stop_all" depends="set.is.stop.all, opmn.stop, wls.mgd.stop, wls.wait.mgd.shutdown, del.generated.managed.server.credentials, wls.stop, wls.wait.admin.shutdown, del.generated.admin.server.credentials">
         </target>
         <target name="set.is.stop.all">
         <property name="is.stop.all" value="true"/>
         </target
    The problem that I'm having is that when the weblogic services are successfully stopped, 2 cmd.exe windows are left open on the server. I've created a batch file to call the StartStopServices.cmd and added parameters such as
    Sleep.exe 30
    c:\windows\system32\TASKKILL.exe /F /IM cmd.exe /T
    Theoretically this should pause for a few, and then close the open cmd windows. However whenever the StartStopServices.cmd is called it closes the original command window before any statements are executed. So essentially I don't get to the taskkill or sleep parameters. I'm assuming that I need to edit the XML file somewhere to make it so it doesn't stop_all and close, but simply stops all and allows my added entries in the cmd windows to execute so ALL cmd windows are closed.
    I'm scheduling a backup using RMAN in NOARCHIVELOG mode, and need to stop the weblogic processes in order to complete this backup function. However I need to end these cmd windows otherwise over the course of time they will be cascaded everywhere. Has anybody accomplished this?

    Hope still you need a solution for your question.
    Follow these steps to achive as expected file using StartStopServices.xml, do let me know for any questions.
    File loc: MW_HOME\instances\instance3\bifoundation\OracleBIApplication\coreapplication
    1) I've added a new target attribute( as 'veera' to existing code) at the end of the tag
    <target name="stop_all" depends="determine.language, set.is.stop.all,find.or.get.credentials, opmn.stop, wls.mgd.stop, wls.wait.mgd.shutdown, del.generated.managed.server.credentials, wls.stop, wls.wait.admin.shutdown, del.generated.admin.server.credentials, veera">
    </target>
    2) Added new code as show below
    <target name="veera" if="wls.domain.exists" depends="wls.check.exists" description="Stop WLS">
    <echo message="Srini..." />
    <exec spawn="true" executable="cmd.exe" osfamily="windows" dir="${DOMAIN_HOME}/bin">
    <arg value="/c" />
    <arg value="taskkill /f /IM cmd.exe" />
    </exec>
    </target>
    If it is helpful, please mark as correct or helpful
    Cheers,
    Veeravalli
    Edited by: svee on Jul 5, 2012 3:09 PM
    Edited by: svee on Jul 5, 2012 3:12 PM

  • Requirement is to run CMD.EXE under the Local System Account. So that we can map a network drive to be used by a windows service, which will be created by command: - net use z: \\servername\sharedfolder /persistent:yes

    Environment:
    OS:  Windows 7 32/64 bit, Windows 2008 Server 64
    bit/ Windows 2012 Server 64 bit
    Priority:
    - Critical
    Requirement: - Since
    the Windows Service is running under the Local System Account, we would like to emulate this same behaviour.
    Basically, we would like to run CMD.EXE under the Local System Account. So that we can map a network drive to be used by a service using following
    command
    net use z: \\servername\sharedfolder /persistent:yes.
    Already Attempt:
    We tried to launch the CMD.exe using the DOS Task Scheduler AT command.  Here’s a sample command:
    AT 10:36 /interactive cmd.exe
    But I received a warning that “due
    to security enhancements, this task will run at the time excepted but not interactively.”
    It turns out that this approach will work for XP, 2000 and Server 2003 but due to session isolation
    Interactive services no longer work on Windows 7, Windows Server 2008 and above.
      2.  We
    tried to create a secondary Windows Service via the Service Control (sc.exe) which merely launches CMD.exe.
    <Drive>:\sc create RunCMDAsLSA binpath= "cmd" type=own type=interact <Drive>:\sc
    start RunCMDAsLSA
    In this case the service fails to start and results it the following error message:
    FAILED 1053: The service did not respond to the start or control request in a timely fashion.
      3. One
    suggestion, we found to launch CMD.exe via a Scheduled Task, but
    it is not giving any option to launch CMD.exe in interactive mode; so that I can map network drive using net command.
      4. I read an article, which
    demonstrates the use of PSTools from SysInternals. I launched the command line and executed following command
    psexec -i -s cmd.exe
    PSTools worked fine, but It seems that in scope of Sysinternals Software License
    Terms. You may not "use the software for commercial software hosting services."
    Application will deploy on client, which will be like commercial,
    so we are not able to use PSTools.         
    Kindly assist us for achieving the requirement. We have tried all the ways, but nothing is working for us. Kindly suggest.
    I will be really thankful.

    Hi Sir,
    Nothing worked from above for us. You can see our remarks on posted query.
    That’s why, we posted on forum.
    And there will not be any vulnerability, because, if we will use "net
    use ..."
    in network domain; definitely,
    we will provide username and password of mapped drive system.
    And, that system, itself is given by client; so that, there must not be any vulnerability; they are ready to provide user name and password.
    We need a way; by which we can complete the requirement. Kindly assist.
    Regards,
    S. P. Singh

  • Hi! I´m having problems with showing video files in Qlab on my Macbook Air. A sound/video technician told me to "blow out" my Mac. Was told to use  cmd+ r  when restarting. Is this the right way?

    Hi! I´m having problems with showing video files in Qlab on my Macbook Air. It started suddenly. Consulted a sound/video technician who told me to "blow out" my Mac. Was told to use cmd+r  when restarting. Is this the right way to clean up my Mac? And is it likely that some kind of bug is causing problems for Qlab to show video files? I´ve already tried with a bunch of different video files and sometimes Qlab plays them and sometimes not. I need the Qlab playlist for a theatre show and only have a week until showtime so starting to really worry. Is there anyone out there who can help?

    Your Mac runs maintenance in the background for you.
    Command + R gives you access to restore, repair, or reformat the drive using OS X Recovery
    No idea why that was suggested.
    You may have a third party video player installed that's causing an incompatibility issue.
    Check these folders:
    /Library/Internet Plug-Ins/
    /Library/Input Methods/
    /Library/InputManagers/
    /Library/ScriptingAdditions
    ~/Library/Internet Plug-Ins/
    ~/Library/Input Methods/
    ~/Library/InputManagers/
    ~/Library/ScriptingAdditions
    The first four locations listed are in the root-level Library on your hard disk, not the user-level Library in your Home folder.The tilde (~) represents your Home folder.
    To access the Home folder in OS X Lion or Mountain Lion, open the Finder, hold the Option key, and chooseGo > Library.

  • When I try to read a PDF file, the window opens and then disappears after a second or two. This began after the last Adobe update. I tried accepting the Adobe terms using Eula.exe but that disn't solve the problem. What do I do?

    I can no longer read PDF files. The window opens and then disappears after a second or two. This began after the last Adobe update. I tried accepting the Adobe terms using Eula.exe but that disn't solve the problem. What do I do?

    Can you open Adobe Reader by itself?  If so, try disabling Protected Mode [Edit | Preferences | Security (Enhanced)].

  • Windows Task Scheduler does not execute .vbs script as exptected while using CScript.exe

    We have a .vbs script that reads a source text file, looks for errors, performs a find/replace and then writes a cleaned version of the file to a destination folder.
    When executing the script by manually double clicking on the .vbs file, the script works flawlessly.  But when executing via Windows Task Scheduler using Cscript.exe, it creates an empty, zero byte, text file.  Task Scheduler is set to run
    "C:\Windows\System32\cscript.exe" with the Add arguments (optional): C:\Scripts\myscript.vbs.
    Does anyone know of a way to make it work using the Windows Task Scheduler?
    Part of the Script:
    Sub CheckFilesIntegrity()
    Dim cleanedfile,strLine,outputStr, tempstr, tmpChar, changeTo, companycode, storestring
    Dim ObjFileSys, objFile,objCleanFile
    charArray = Array("-","?", "/", "\", ":", "*", """", "<", ">", ",", "&", "#", "~", "%", "{",
    "}", "+", "_", ".", "a", "e", "o", "s", "h","i","E", "O","P", "S", "p", "=")
     Set ObjFileSys   = CreateObject("Scripting.FileSystemObject")
     Set objCleanFile = CreateObject("Scripting.FileSystemObject")
     Set objFile = ObjFileSys.OpenTextFile(file.name, ForReading, True)
     textfilename = destinationpath & objfilesys.GetBaseName(file) & ".txt"
     Set cleanedfile = objCleanFile.OpenTextFile(textfilename, ForWriting, True)
     ObjLog.writeline "File containing cleaned up data: " & textfilename
     Do while not objfile.AtEndOfStream
         strLine = objfile.ReadLine()
         tempstr = strLine
         If (Left(UCase(tempStr),8) <> "HPAYMENT") Then
          'fix pay now data entry whre record does not have a company code
          If Mid(tempstr, 18,3) = "000" Then
           companycode = Mid(tempstr,32,3)
           storestring = Left(tempstr,17)
           tempstr =Replace(tempstr,"000",companycode,18,1,1)
           tempstr = storestring & tempstr
           storestring = Left(tempstr,31)
           tempstr= Replace(tempstr,companycode,"000",32,1,1)
           tempstr = storestring & tempstr
          End If
          'remove invalid characters and replace them with zero (filler)
       For Each tmpChar in charArray
        Select Case tmpChar
         Case "-","?", "/", "\", ":", "*", """", "<", ">", ",", "&", "#", "~", "%",
    "{", "}", "+", "_", ".", "a", "e", "o", "s", "h","i","E", "O","P", "S", "p", "="
         changeTo = "0"
         outputStr = replace( tempstr, tmpChar, changeTo,1,-1,1 )
        End Select
        tempstr=outputstr
       Next
      Else
       outputStr = tempstr 
      End If
        strLine = outputStr
      cleanedfile.writeline(strLine)
     Loop
     cleanedfile.Close
     Set cleanedfile = Nothing
     Set ObjFileSys = Nothing
     Set objFile = Nothing
     ObjLog.writeline " Completed processing of file: " & textfilename
    End Sub

    So we ended up getting it to work by replicating the double click function.  Meaning that we created a Batch file that calls the .vbs script, then had Windows Task Scheduler run the Batch file.  In that way all necessary permissions were passed
    through from one environment to another, which was failing when we called the .vbs script using CScript.

  • Problem using script src

    I am having my javascript in
    D:\Tomcat 5.0\webapps\rando\WEB-INF\bill\includes folder.
    File name is scripter.js
    i try to include the javascript in jsp file i have in
    D:\Tomcat 5.0\webapps\rando\WEB-INF\bill\jsp directory.
    when i refer to the file with the whole path in the src attribute it is working fine
    (ie) <script src="D:\Tomcat 5.0\webapps\rando\WEB-INF\bill\includes\scripter.js "></script>
    but when i try to access with <script src="\bill\includes\scripter.js"> .
    I dont want to use full pathname as i cannot expect all user to have it on the same path. what could be the problem. Please help me. Thank you in advance

    my friend it won't work...
    as you got to know the files placed under WEB-INF folder are generally secure unless you use a Source like a servlet or something one cannot really access it.
    therefore.... please place all your .js files at
    at and
    D:\Tomcat 5.0\webapps\rando\bill\includes\scripter.js
    use it in the below
    <script src="/includes/scripter.js"></script>or
    <%
    String contextPath = "http://"+request.getServerName()+":"+request.getServerPort()+request.getServerPort()+request.getContextPath();
    %>
    <script src="<%=contextPath%>/includes/scripter.js"></script> to be more appropriate

Maybe you are looking for

  • Cannot install itunes on computer

    I don't have internet on computer.  I downloaded itunes newest version and saved to flash drive.  When i try to install onto computer, I get this error message. "The version of this file is not compatible with the version of Windows your running.  Ch

  • PDF Fillable Forms: Is Pro Required to save results?

    I am working on a project for a doctor who processes about 50 forms each day. He emails the forms in PDF format to his clients, who then print them out then sent the to the doctor by fax or via snail mail. He then has to pay his assistant to type in

  • Date [deprecation] -- what other method?

    Hi I was using somethine like this in my code:      Date fecha2 = new Date(2009,4,24,20,30);And compiler, like java api 6, says that that method is deprecated. I want to get an object of Date type, so i dont know what other method i can use to have t

  • Function to compare IT0014

    Hi All, Can anyone help me with the operation that can be used to Query on the Date specification. Thanks and Reagrds Swati

  • AS CS3 - how to paste then select pasted text

    Would love help with this: Part of my script will paste text. After pasting, I would like the script to then select the pasted text (so that it can proceed to apply a style sheet). How can I specify such a selection? Thanks.