Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-09-10
7
Medium Priority
?
162 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 85

Accepted Solution

by:
oBdA earned 500 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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
LVL 85

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 85

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
Today as you open your Outlook, you witness an error message: “Outlook is using an old copy of your Outlook Data File…”. Probably, Outlook is accessing an old OST file.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

879 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