Solved

MS DOS Set Time

Posted on 2004-08-12
13
1,063 Views
Last Modified: 2012-08-14
I'm writing a script set_time.sql
the sets a time variable by hosting to dos.

The variable displays the current time the first time the script is called from SQL>@set_time
but when I executed the script again,
the variable stays the same.

My question is how to refresh (clear) the variable
so each time the script is called it displays the new time?

host Set HHMISS=%TIME%
host echo %hhmiss%
0
Comment
Question by:revxprts
  • 8
  • 5
13 Comments
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787127
do a

host Set HHMISS=
host Set HHMISS=%TIME%
host echo %hhmiss%

This should clear it each time, first.

J
0
 

Author Comment

by:revxprts
ID: 11787169
I tried that already--the time did not change.
0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787226
ok just a sec
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 9

Expert Comment

by:jdeclue
ID: 11787257
THis is odd... it is working flawlessly for me. What kind of machine are you running on NT/2000/2003?

J
0
 

Author Comment

by:revxprts
ID: 11787345
I'm on a Windows 2000 machine, partitioned into C: and D: drives.

=========
set_time.sql
=========
host Set HHMISS=
host echo %hhmiss%

host Set HHMISS=%TIME%
host echo %hhmiss%

=========
=========
D:\> dir
set_time.sql

D:\> sqlplus /nolog
D:\> connect system/passwd
D:\> @set_time

-- time stays the same
0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787410
what happens whe you go to a command prompt and do it manually, are they the same time?

set time=
set time=%TIME%
echo %TIME%

set time=
set time=%TIME%
echo %TIME%
0
 

Author Comment

by:revxprts
ID: 11787423
It works fine from the command prompt.
0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787489
the sqlplus is not holding the environment between commands. Can you put this in cmd file and call it?

J
0
 

Author Comment

by:revxprts
ID: 11787568
I don't understand
0
 
LVL 9

Accepted Solution

by:
jdeclue earned 500 total points
ID: 11787747
Create a text file on d:\time.cmd

Put this in the text file:

@Echo off
Set HHMISS=
Set HHMISS=%TIME%
echo %hhmiss%

then call

host time.cmd

0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787937
So, that worked?

J
0
 

Author Comment

by:revxprts
ID: 11787941
You ROCK!
0
 
LVL 9

Expert Comment

by:jdeclue
ID: 11787955
Thank you sir ;)

J
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to find out who did last update on user account in AD 9 230
auto copy 8 617
Windows 2000 Server to 2008 upgrade 8 519
Windows 7 7 269
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Some of the SEO trends we might expect in 2017.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 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