Solved

MS DOS Set Time

Posted on 2004-08-12
13
1,058 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
 
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

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…
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques. This attack comes as a nightmare trifecta for email filtering services; sent from a familiar contact, using authentic tone and verbi…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now