Solved

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

Posted on 2004-09-10
7
156 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 84

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
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.

 
LVL 84

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 84

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

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…
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

740 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