Error opening script file - location error

 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Error opening script file - location error
# 1  
Old 02-10-2010
Error opening script file - location error

Hello,

I know nothing about UNIX, ftp, etc. I am building an excel VBA macro which calls a .bat file. I've taken a pre-existing batch file and am trying to modify it to fit my purposes. I would be very grateful for some assistance.

Here is my .bat file:

Code:
echo off
set tempfile="serverX\temp.txt"
> %tempfile% echo open focprd
>>%tempfile% type "serverX\download.xls"
>>%tempfile% echo bye 
ftp -s:"%tempfile%"
del %tempfile%
exit

So, my problem is with the line of code: ftp -s:"%tempfile%"

In the ftp, I get a line which says there is an error opening script file and then it gives me a partial location of where the file is located.

The temp file is created exactly how I want it and in the location I want, I just can't get the temp file to open in ftp.

One side note which may or may not be of importance. The file is located in a location similar to this: serverX/AB - Here.

When the ftp fails to open the script, it shows the location of the file as only serverX/AB. It does not include the "-" and everything after it. But if ftp can create the temp file in this location, I do not see how it has an issue running the script. Thanks again for whatever help I get.
# 2  
Old 02-10-2010
ok once i wrote a script transferring data from windows to solaris. I try to help :

first of all "s" option comes with ftp means that your ".bat" script which includes ftp line will call codes from a .txt file ( that include main ftp codes like hash, mput etc).

second your ".bat" should be located in same directory as the txt file. So check if your ".bat" file calls the "serverX\temp.txt" from right place, this is so important. Let me give a very simple example too:

batch script:
Code:
@ftp -i -d -v -s:test_123.txt
cd \files2transfer
del /s "*.txt"

test_123.txt file which includes ftp:
Code:
@Echo Off
open "Server IP her e"
root
"root_password_here"

lcd D:\Backup2\backup
cd /LOGS/applications_backup/IVR

binary
hash on
mput "*.rar"
disconnect
bye

# 3  
Old 02-10-2010
Quote:
Originally Posted by starcraftbud
In the ftp, I get a line which says there is an error opening script file and then it gives me a partial location of where the file is located.
Does the path have a space in it anywhere? It may be considering only the part of the file up to the space as the argument.
# 4  
Old 02-10-2010
FTP means File Transfer Protocol. It is used for transferring file from one node to another place. The fundamental parameters to FTP are: Destination Server Address, Username, Password, file type (ASCIII/Binary), Source Filename, Destination Filename.

Your batch file contains multiple syntax and logic errors on every line.
It is not possible based on the evidence presented to determine what the MSDOS Batch File is intended to do.

Ignoring syntax etc. what do it the MSDOS Batch File intended to do?
Hints:
What is the Network name of the destination Server?
What is the ftp username and password? (don't post real ones).
What is the format of the file (ASCII/Binary)?
What is the name of the source file?
What is the name of the destination file?

Last edited by methyl; 02-10-2010 at 07:18 PM.. Reason: Remove comment
# 5  
Old 02-10-2010
Hello again. Thank you very much for the responses. I will try to answer your questions to the best of my ability. I am in a location where I cannot access the files, but I should be able to answer by memory.

Eagle - I will double check the that the .bat file calls the .txt file from the right location, but I doubt this is the issue because I was meticulous in creating the files. And yes, I believe the .bat file and the .txt file which get created are located in the same directory. They are both stored in the same folder.

Corona - The path does have a space in it. How would I get ftp to consider the entire path? As I mentioned in my first post, the error appears to be at the space. Perhaps restating it will help. The files are saved in a location: U:shared/common/FA - Files

The error says it cannot run the script from the location. In the ftp it shows only: U:shared/common/FA.

It is missing the last "- Files". Without changing the folder name, how can I correct this?

Methyl - I did not reveal enough information to make the .bat file's complete intent. This .bat file is based on a larger VBA project in a different application. The batch file is intended to create a temporary file which pulls data from an excel spreadsheet (the data changes). The spreadsheet is set up in such a way that it contains all the remaining proper syntax required to transfer all the files I need. Once the spreadsheet's data has been pasted into the temporary .txt file, the .txt file is complete will all the data I need. At this point, the .bat file is supposed to "run" this .txt file in ftp.

In my first post, I mentioned the .txt file is created exactly how I need it. I can manually type out the .txt file in ftp and it works as it is supposed to. The issue I have is why the .bat file cannot run the .txt file through ftp in the location it currently is. I know very little about Unix and ftp so it does not surprise me that the syntax or logic is bad, but for my purposes, I think the functionality is very nearly complete.

The network name of the server is: U:shared/common/FA - Files
Everything including the excel sheet, .bat file, and .txt file which gets created are all located in the folder called "FA - Files". I am not 100% sure of the format. I know the excel file is a special format. I "borrowed" it from other processes which use ftp. Source file, destination file, and ftp username and passwords are all in the excel file - which correctly go into the .txt file.

Thanks again guys. I'm hoping these details can help clear things up. I think the space in the path name is my issue. Changing this will not be easy unfortunately.
# 6  
Old 02-11-2010
Quote:
Originally Posted by starcraftbud
Corona - The path does have a space in it. How would I get ftp to consider the entire path?
You could try using 8dot3 paths, which will avoid using characters like spaces but refer to the same existing file. Run dir /X in a DOS window to see what a file or dir's 8dot3 name is. "C:\Documents and Settings\Administrator\" may become "C:\DOCUME~1\ADMINI~1\" and so forth.
# 7  
Old 02-12-2010
Hey Corona. That might not be a bad idea. And I appreciate the help you've given thus far, but I don't quite follow how to find the 8dot3 path. I have Windows XP, could you be a little more specific in how I can go about finding the 8dot3 path? Thanks a lot for your help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

LibGL error when opening GUI version of MATLAB

Hi all, Today, I have a question regarding a libGL error. Currently, I access linux server by using the terminal application in MAC. However, when I try to use GUI version of MATLAB, I have faced an error message as shown below. libGL error: No matching fbConfigs or visuals found libGL... (1 Reply)
Discussion started by: syg3434
1 Replies

2. AIX

Opening a file in vi editor is giving out of memory error

Below is the error: Out of memory saving lines for undo - try using ed : Please help me how do I open this file. Best regards, Vishal (5 Replies)
Discussion started by: Vishal_dba
5 Replies

3. Solaris

Library error while opening firefox

I have Solaris-10 zone, where I can open firefox in GUI via MobaXterm with root user, but when I try to open it with non root user, it fails with below error $ which firefox /usr/bin/firefox $ firefox ld.so.1: firefox-bin: fatal: relocation error: file... (6 Replies)
Discussion started by: solaris_1977
6 Replies

4. AIX

Error opening device: /dev/fscsi0

Hello, One one of my AIX boxes I'm having the following errror: fcstat fcs0: Port Speed (supported): 4 GBIT Error opening device: /dev/fscsi0 errno: 0000003d Has anyone encountered similar errors? Thank you! (1 Reply)
Discussion started by: aixn00b
1 Replies

5. Solaris

Error opening PAM libraries : solaris 10 on vmware workstation

Hi Admins, I am facing an issue with Solaris 10 sitting on vmware workstation... When I start it, it gives me an error : "Error opening PAM libraries, contact system administrator" Also I can reach it via putty, but none of the id/passwd working. I did revert pam.conf. But still no... (2 Replies)
Discussion started by: snchaudhari2
2 Replies

6. Solaris

Very Importan - Vim Settings - Error while opening a File using vim

I downloaded vim.7.2 and compiled the vim source . Added the vim binary path to PATH (Because iam not the root of the box) when i load the file using vim it throws me an error Error detected while processing /home2/e3003091/.vimrc: line 2: E185: Cannot find color scheme darkblue line... (0 Replies)
Discussion started by: girija
0 Replies

7. Programming

Error in opening a file C++

Hi, I have written a function which will open the file with the input name provided.Input name is in string format so while opening I am converting it using c_str().detail code below Plz let me know what is the wrong in code. 1 #include<iostream> 2 #include<fstream> 3 ... (4 Replies)
Discussion started by: forstudy3
4 Replies

8. Windows & DOS: Issues & Discussions

error opening website

hi I have unusual problem you might say. I can't open microsoft.com , I've checked file hosts located somewhere in windows/system32/drivers .. and its not blocked from there, what else could cause this problem, I need to download microsoft visual studio and I can't cause I can't open the website,... (1 Reply)
Discussion started by: c0mrade
1 Replies

9. Programming

Error found while opening any pdf file from IE 6

Hello All, My application is followed J2ee architecture. It contains Java and jsp codes. This application generates some reports in pdf format. I am using Weblogic 10.3 and jdk 6. While I want to open the pdf in IE 6 with service pack 2 , the pdf not showing properly. It comes in byte code.... (3 Replies)
Discussion started by: priyankak
3 Replies

10. Shell Programming and Scripting

error while opening files in a directory

I tried opening the files in a directory and print thier names. But it was thowing the error "unable to open directorty at t5.pl line 2." Can u plz correct this error in below mentioned code. #!/data/scoredev/perl opendir(HOMEDIR,"c:\vin") || die("unable to open directorty");... (3 Replies)
Discussion started by: vinay123
3 Replies
Login or Register to Ask a Question