Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WinXP .bat file does not work on Win7 machine

Posted on 2011-03-02
17
Medium Priority
?
737 Views
Last Modified: 2012-06-27
I had a .bat file on a Win XP machine that executed fine.  I moved the .bat file to a Win7 machine (copied) and now it does not work.  Any clues??  
0
Comment
Question by:sburge1962
  • 7
  • 5
  • 3
  • +2
17 Comments
 
LVL 9

Expert Comment

by:AriMc
ID: 35022062
Could you post the contents of the BAT and explain how it fails?

0
 

Author Comment

by:sburge1962
ID: 35022099
cd \Program Files\SEAGULL\BlueZone\Transfer
ftp -s:ftp_visa

It grabs a file that we rename to "1" from the Windows server to a Unix box.  We then execute a process on the Unix box that updates records from that file.  The Unix command appears to be updating the records, however the records are never updated.  I can run the same exact .bat file on the previous XP machine, again run the Unix process and the records update.
0
 
LVL 9

Expert Comment

by:AriMc
ID: 35022165
- Does the file get transferred too so that your Unix command really gets a new file instead
  of an old one?

- Did you remember to copy the FTP-script file "ftp_visa" from your XP to W7?

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 9

Expert Comment

by:AriMc
ID: 35022192
Just in case you might also want to put the path containing spaces in double quotes and
supply full absolute paths, ie:

cd "c:\Program Files\SEAGULL\BlueZone\Transfer"
ftp -s:"c:\Program Files\SEAGULL\BlueZone\Transfer\ftp_visa"

0
 

Author Comment

by:sburge1962
ID: 35022194
Hmmm.  I did not copy any script file?  However, I have two .bat files that I run and the .bat files runs fine and I did not move that script either?  Where would I find this scipt file?
0
 
LVL 9

Assisted Solution

by:AriMc
AriMc earned 1000 total points
ID: 35022218
The command "ftp -s:ftp_visa" instructs ftp to load a script file named ftp_visa. Since you do CD to "\Program Files\SEAGULL\BlueZone\Transfer" directory, it's probably there.

0
 

Author Comment

by:sburge1962
ID: 35022263
Niether script file is in this folder.  Here is a copy of the other .bat file that runs just fine.

cd \Program Files\SEAGULL\BlueZone\Transfer
ftp -s:ftp_eft41

The only differnce is that the files this script graps are plain text.  The other file looks to be encrypted or something?  Anyway, I can't read the contents of the file.  I am sorry I am such an idot when it comes to script files.
0
 

Author Comment

by:sburge1962
ID: 35022272
Weird.  I can see the script files when I open my FTP program that I use to transfer it from a remote FTP site into the Win7 box, but I can't see it when just viewing the folder contents locally
0
 
LVL 9

Expert Comment

by:AriMc
ID: 35022290
Those script files must be somewhere on your XP machine. Try looking for ftp_visa and ftp_eft41 from the root folder of that computer.

0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 35022318
does it work this way ?

cd %ProgramFiles%\SEAGULL\BlueZone\Transfer
ftp -s:ftp_eft41
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 35022347
Would be good if you can post a screen shot of the failure.

That said, if you just copied and didn't edit, what version of Windows (x86 or x64).  Is that "Seagull" program installed and confirmed it's in the path your specifying?
0
 

Author Comment

by:sburge1962
ID: 35022361
If you could tell me how to stop the .bat file before the window closes, I can post a screen shot of what errors out.  I am not sure how to do that and the process happens so fast, I can not tell what is happening.
0
 

Author Comment

by:sburge1962
ID: 35022375
The scripts are located the the TRANSFER folder as they should be.  I am not sure why I can't view them.  Possibly a protected file?
0
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 1000 total points
ID: 35022463
Run the batch file from a command prompt - don't double click it.  

If you MUST double click it, add a line at the end of the file containing pause

@echo off
echo Hello World
pause
0
 

Author Comment

by:sburge1962
ID: 35022648
This helped me determine where it is erroring.  It is not finding the file "1".  When we renamed the file "1" on the XP, it did not automatically add .txt to the file name.  Win7 does.  So, it is not finding the file because the file name is 1.txt.  I guess a stupid question, how do I save a file in Win7 as with no extention??
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 35022681
Put the file name in quotes when you save it.
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 35022786
Or just append a dot to the file name when saving.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Suggested Courses
Course of the Month12 days, 12 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question