Solved

How to automatically run certain batch files when system is reboot?

Posted on 2004-09-10
7
154 Views
Last Modified: 2011-09-20
I have to manually run sdkvars.bat to use C# compiler each time I reboot MS Dos under Windows 2000.  How to set the system environment variables or something else to make sdkvars.bat to run automatically when I reboot my computer or MS DOS?
Thanks for any help in advance.
0
Comment
Question by:siyu
  • 3
  • 3
7 Comments
 
LVL 15

Expert Comment

by:Yan_west
ID: 12029079
Just add the batch file in the startup folder.. or do you need to start it before you login?
0
 
LVL 83

Accepted Solution

by:
oBdA earned 125 total points
ID: 12029208
Simply enter them to the persistent environment variables.
Right-click "My Computer", Properties, Advanced tab, button "Environment variables". Add the variables defined in the batch file to your profile (or the machine profile, if other users need those as well).
0
 
LVL 1

Author Comment

by:siyu
ID: 12029454
Thanks, oBdA

I have another batch file  and I have to run it manually too, its content is not as simple as sdkvar, do you know how to automatically run it whenever I reboot system?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 83

Expert Comment

by:oBdA
ID: 12029514
By adding a shortcut to the batch file in the startup folder in your start menu?
Or what does that batch do?
0
 
LVL 1

Author Comment

by:siyu
ID: 12029767
Thanks for your response.
I added the shortcut to the batch file in C:\Documents and Settings\myloginname\Start Menu\mybatch.bat, but it doesn't run when I reboot my pc. This batch file allows me to access my company's network drives, its content is like this:

net use /delete * /y

:Transactiondata
ifmember transactiondata
if not errorlevel 1 goto processing
net use m: \\mycompany\days

:processing
ifmember processing
if not errorlevel 1 goto sales
net use n: \\myapp1\eps
net use O: \\zontalk\ztalk
net use R: \\mycompany\processing

:sales
ifmember sales
if not errorlevel 1 goto services
net use S: \\mycompany\sales
.....

Any idea? Did I put the shortcut in wrong place?
0
 
LVL 83

Expert Comment

by:oBdA
ID: 12029994
Yes; that shortcut needs to go into the folder named "startup" (assuming you're using an English version); Start Menu\Programs\Startup
0
 
LVL 1

Author Comment

by:siyu
ID: 12030146
Thank you again, it works now. =:)
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

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…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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