Computing.Net > Forums > Disk Operating System > Use Date time in Filename

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Use Date time in Filename

Reply to Message Icon

Name: normie
Date: January 21, 2004 at 15:16:11 Pacific
OS: xp
CPU/Ram: 1ghz 1gb
Comment:

Thanks to this wonderful list, I created a bat file which dials an existing DUN entry (using RAS Dail 95), then using WCL_FTP tool, it sends a file to a server giving it a filename which is append with the current date time. Sounds good right??
Until I try it on a Win98 machine. This bat file has been tested on XP and W2k.

Any ideas why it doesn't work. My guess is the date commands aren't recognised by Win98.

here is the file...
@echo off
REM This file cannont be deleted, and should only be edited by the network administrator.
REM To Set this file for a new store, edit the FTP Variables

:DUN Variables

set DUNProgram=rasdial95.exe
set DUNEntry=ISP
set DUNPhone=ISP PHONE NUMBER
set DUNUserName=ISP USERNAME
set DUNPassword=ISP PASSWORD

:Sharptrak Details

set STORENAME="ENTER STORE NAME HERE"
set InstallFolder=c:\installpath

:FTP User Variables

set FTPSERVER=ServerAddress
set FTPUsername=username
set FTPPassword=password

:FTP Program variables

set FTPProgram=wcl_ftp.exe
set UploadFileExtension=_%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%_%Time:~0,2%%Time:~3,2%.mer
set JobsFile=uploadfile.ext
set FTPTitle="Sending Jobs"
set FTPServerPath=/
set FTPCommand=put
set FTPSwitches=1 0 0 1


:Batch File starts Here

cd %InstallFolder%\components

:Connect to ISP
echo "Connecting to the Internet"
%DUNProgram% %DUNEntry% %DUNUserName% %DUNPassword% /Phone:%DUNPhone%


%FTPProgram% %FTPTitle% %FTPSERVER% %FTPUsername% %FTPPassword% %FTPServerPath% %STORENAME%%UploadFileExtension% %JobsFile% %FTPCommand% %FTPSwitches%

Any help would be appreciated.



Sponsored Link
Ads by Google

Response Number 1
Name: Wengier
Date: January 21, 2004 at 15:31:20 Pacific
Reply:

So, that is because DOS batch and NT scripting are different! You should know that Windows XP does not include "DOS". The "Command Prompt" in WinXP is just the WinNT/2K/XP system console, which is not DOS, and the WinNT/2K/XP Console scripts are NOT DOS batches! Below is the *quotation* from the warning messages of this forum:

"DO NOT post questions related to NT Batch scripting on this forum. Use the Programming forum.

Use the Windows NT, 2000 or XP forum for questions regarding the Windows NT, 2000 or XP "DOS" command prompt."


0

Response Number 2
Name: normie
Date: January 21, 2004 at 15:52:39 Pacific
Reply:

But that is just my point.

I want to know how to make this file work in Win98. Please read the message carefully before you post a critisism.


0

Response Number 3
Name: Wengier
Date: January 21, 2004 at 16:05:30 Pacific
Reply:

Normie,

"Until I try it on a Win98 machine. This bat file has been tested on XP and W2k.
Any ideas why it doesn't work."

This is your FIRST question (in Response #1), isn't it? The differences between DOS batch and NT script is why it doesn't work.

To answer your SECOND question ("how to make this file work in Win98") in Response #2, more details, especially the error messages, is needed to diagnose your problem more quickly and directly. So could you tell us the error messages you have seen when you run it in a Win98 DOS box?


0

Response Number 4
Name: Wengier
Date: January 21, 2004 at 16:15:12 Pacific
Reply:

By the way, in my responses, I have assumed that the network and the WCL_FTP tool have been installed and configured correctly on your Win98 machine as well. But if this presumption is not true, then it could also be the cause of the problem.


0

Response Number 5
Name: Wengier
Date: January 21, 2004 at 16:48:50 Pacific
Reply:

I have do some more research on the Internet about the WCL_FTP tool that he have used. Here is the offical desciption of this program from the website:

"WCL_FTP is a basic Windows Command Line FTP program. It was designed to do a very limited set of FTP commands, without user intervention. It is completely command line driven. What this means is that it is perfect for batch or automated programming or adding FTP capability to programs that need it. It works seamlessly with other programs, even taking a parameter on the command line that specifies the caption at the top or the ftp form, so it becomes part of your program. To use WCL_FTP, you simply create a shortcut to the program with the parameters as follows in the command line to start the program, or use a batch file to start it.

Supported platform: Win98/ME/2000/XP"

From the upper formal desciption for WCL_FTP, we can know this is a Windows command-line (Win32 Console) mode FTP program. It won't work in DOS (or pure DOS), so it's not really a DOS program. Thus you'd *better* ask your question in the Windows XP Forum, Windows 98 Forum or Networking Forum, rather than DOS Forum, and you have a better chance to be answered there than here. I'm trying to be more polite to redirect your question to the more appropriate forum. Good luck!


0

Related Posts

See More



Response Number 6
Name: joe-g
Date: January 21, 2004 at 22:45:03 Pacific
Reply:

With the exeption of OS specific scripting, such as NT scripting, this is the forum for ALL flavours of DOS, (including "simulated DOS" since it still "walks like a duck...)

It may also belong in "programming", however, it also belongs here, so why criticise if you cant help?


0

Response Number 7
Name: Wengier
Date: January 22, 2004 at 05:12:55 Pacific
Reply:

joe-g,

I only said in Response #5 "you'd *better* ask your question in a different forum, rather than DOS Forum, and you have a better chance to be answered there than here.". I'm not saying "you must ask your question in ...". It seems that you didn't read my reply carefully. And I also said in Response #3 "To answer your SECOND question ("how to make this file work in Win98") in Response #2, more details, especially the error messages, is needed to diagnose your problem more quickly and directly." I'm waiting for his answer. So if you can't help, then please read my responses carefully before posting a reply.


0

Sponsored Link
Ads by Google
Reply to Message Icon

how do i install dos on m... Restoring DOS backup in W...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Use Date time in Filename

include date/time in copy filename www.computing.net/answers/dos/include-datetime-in-copy-filename/16493.html

Inserting date/time in log file www.computing.net/answers/dos/inserting-datetime-in-log-file/8988.html

Rename file to date.time.txt www.computing.net/answers/dos/rename-file-to-datetimetxt/14166.html