Solved

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

Posted on 2004-09-10
7
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 
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

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.

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…
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

710 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