Link to home
Start Free TrialLog in
Avatar of Darth_Cheney_Jr
Darth_Cheney_Jr

asked on

How can you run a batch via autoexec.nt??????

I'm trying to run a simple batch file at startup via the autoexec.nt and cant get the darn thing to run.
Is it because you somehow have to initialize a dos environment first, execute the bat, then start the shell?
I have no idea what I'm doing, so Any help would really be appreciated.  thanks in advance.
Darth

More possibly useless info: eventually the batch will del the index.dat files that are all over the place. I assume, since they're protected files, they have to be either deleted in dos or in a windows session when no user is logged on. However the one I'm trying to get to work is simply:
<E:\Docume~1\User\Desktop\Folder\*?.*>
(No protected files there)


I tried putting this in the autoexec.nt file
(the file is called test.bat)
c:\test.bat
then
e:\test.bat (E being the system drive)
then
cd c:
c:\test.bat

etc etc etc ...

Darth Newbie








Avatar of slink9
slink9

This is from the XP help.  Maybe it will guide you a little.


To create custom startup files for an MS-DOS-based program that may require a special configuration
Using a text editor, such as Notepad, edit the Config.nt and Autoexec.nt files (located in systemroot\System32).
Save each file with a new name.
Right-click the MS-DOS-based program shortcut, and then click Properties.
Click the Program tab, and then click Advanced.
Under Custom MS-DOS initialization files, type the new names for your custom startup files.
 Notes

This procedure might be required because some MS-DOS programs use special memory and video instructions, or require that other programs be installed prior to their being started. Please refer to the documentation that came with the program before creating startup files.
Use the documentation that came with the MS-DOS-based program to create a shortcut. For more information, click Related Topics.
This option might not be available on some MS-DOS-based programs.
To use custom startup files when starting an MS-DOS-based program, you must start the program from its shortcut.
Creating a program information file (PIF) for an MS-DOS-based program creates a shortcut to the program executable. All the settings saved in the PIF file are contained in the shortcut.
Related Topics
Hi There,

Use the call statement.

IE: Call c:\test.bat
Why don't you just set up a scheduled task in Task Scheduler to run your batch file on system startup?
try putting the path in quotes
<"E:\Docume~1\User\Desktop\Folder\*?.*">
Avatar of Darth_Cheney_Jr

ASKER

Unfortunately nothing has worked so far.  Slink9's comment clued me into "PIFs" Program Information File.  Doing a find for *.pif brings up "Shortcuts to DOS Programs", one that even refers to a Batch file called "_DEFAULT", which you can find using Find.  Maybe I could reverse engineer it, or something...
Is a batch file a "DOS Program"?
If so, can I use a PIF to make it start before the shell?
How?
Jr.
EDitor correction
You CAN'T find _DEFAULT.bat
I found _default.bat in my XP Windows directory by doing a search for ?default.* and including hidden files and system files.
found this interesting reading about the index.dat files in XP
http://miataru.computing.net/windowsxp/wwwboard/forum/11562.html
I also found this
Windows XP uses Config.nt and Autoexec.nt, not Config.sys or Autoexec.bat
If you have a Config.sys or Autoexec.bat file left over from your old system, Windows NT, 2000, and XP will (mostly) ignore them. Nothing in Config.sys will have any effect on your system. Any line in Autoexec.bat that launches a program or changes a directory will be ignored; the only lines in Autoexec.bat that Windows XP will read are the lines that begin SET or PATH.

In order to launch programs or change settings for DOS programs under Windows NT, 2000, or XP, you must modify two files named Config.nt and Autoexec.nt, typically found in the C:\Windows\System32 directory. (Help! I can't find my Config.nt file!) Instructions may be found elsewhere on this page for modifying Config.nt to increase available memory and enable expanded memory and prevent installation and startup errors.

Config.nt is used for the same kind of tasks formerly performed by Config.sys (loading device drivers, etc.). Autoexec.nt is used for the same kind of tasks formerly performed by Autoexec.bat (launching memory-resident programs, etc.) Advanced users should note that only old-style 16-bit DOS programs can be run from Autoexec.nt. You cannot use Autoexec.nt to run 32-bit Windows NT, 2000, or XP text-mode programs like MODE or SUBST; these programs may be run in an ordinary batch file, but not in Autoexec.nt.

Elsewhere on this page, you may download desktop shortcuts that you let you edit Config.nt or Autoexec.nt in Windows Notepad, merely by clicking on the shortcuts.

source
http://www.columbia.edu/~em36/wpdos/windowsxp.html
also I'm sure you know there are third party solutions that will delete them
you could use one of them, and the shortcut for shutting down xp in a batch file, so it will delete the index.dat files, and then shut down
sort of approaching the problem from the other side
OK here’s the here’s the Real Deal.  I read this article the other day http://www.fuckmicrosoft.com/content/ms-hidden-files.shtml

And I want to create an automated way of getting rid of all these files.
You can manually delete these buggers all day long with no problem, but it’s just tedious as heck.
Here are the paths that I need to go through each time.

Index.dat files
e:\Docume~1\Number1\Locals~1\Tempor~1\content.ie5\*?.*
e:\Docume~1\Number1\Locals~1\history\history.ie5\*?.*
e:\Docume~1\Number1\cookies\*?.*
e:\Docume~1\Number1\applic~1\Micros~1\office\recent\*?.*
e:\Docume~1\Locals~1\locals~1\tempor~1\content.ie5\*?.*
e:\Docume~1\Locals~1\cookies\*?.*

Hidden temp files
E:\Docum~1\Number1\LocalS~1\Tempor~1\Content.IE5\s62hj18d\*?.*
E:\Docum~1\Number1\LocalS~1\Tempor~1\Content.IE5\ud8ueu4h\*?.*
E:\Docum~1\Number1\LocalS~1\Tempor~1\Content.IE5\ydhe8du4\*?.*
E:\Docum~1\Number1\LocalS~1\Tempor~1\Content.IE5\ud8ue6ds\*?.*

E:\Docume~1\Locals~1\locals~1\tempor~1\udus8dus\*?.*
E:\Docume~1\Locals~1\locals~1\tempor~1\9b9jn37d\*?.*
E:\Docume~1\Locals~1\locals~1\tempor~1\uf7fn4nd\*?.*
E:\Docume~1\Locals~1\locals~1\tempor~1\9f9jj0jo\*?.*

E:\Docume~1\Defaul~1\locals~1\tempor~1\udfjh36d\*?.*
E:\Docume~1\Defaul~1\locals~1\tempor~1\igj4ysdy\*?.*
E:\Docume~1\Defaul~1\locals~1\tempor~1\ugh4y7u2\*?.*
E:\Docume~1\Defaul~1\locals~1\tempor~1\9fij5jf7\*?.*

E:\Docume~1\networ~1\locals~1\tempor~1\ydy3y9u3\*?.*
E:\Docume~1\networ~1\locals~1\tempor~1\uru48du3\*?.*
E:\Docume~1\networ~1\locals~1\tempor~1\9ij35jh1\*?.*
E:\Docume~1\networ~1\locals~1\tempor~1\ufhrts6e\*?.*

Default User and Number1’s files can easily double for some reason.

The only app I’ve seen that could possibly do this is WindowWasher.
There are just not enough custom paths.
You can delete these manually by logging onto another user, from another OS on a dual boot, or using a command prompt and removing the system attribute from the offending folder (namely tempor~1).  Then a simple batch file works pretty well.
To get it automated , however, is a whole ‘nother  Oprah.
DCJ
windows washer has a wash at shutdown feature, it will wahs, and then shut the machine down
I have not tried this feature (but I do use windows washer)
True, but but it doesn't delete the hidden index files, and there is not enough Custom Paths to delete the hidden Temporary Internet Files\yd7du3je\'s

This question did a 180 also.  I guess this is another question where you should have held your ear to the monitor while typing it so that we could read what you really wanted directly from your brain.
What about a start up script? (run gpedit.msc, Computer Configuration|Windows Settings|Scripts).
OK.  Concerning http://www.fuckmicrosoft.com/content/ms-hidden-files.shtml: this is extremely old.  If you clear your Temporary Internet Files and History in Internet Options these files are cleared, too (excepting any currently viewed sites).  You don't need to be paranoid about these.  You have more to worry about people undeleting your files (which is illegal usually).

Regardless, autoexec.nt and config.nt are only used to initialise the MS-DOS emulation enviroment - e.g. when you run command.com, so if anything it'll be harder to delete the files.  If you want something run at system startup, use Group Policy (in Computer, Windows Settings, Scripts).  I think Group Policy's only installed on Windows XP Professional.  If you want it to work on Home Edition, comment back.

Regards,
    Mark
Actually, you might be able to just put a script in C:\Windows\System32\GroupPolicy\Machine\Scripts\Startup on XP Home...  But I don't have a copy.
Doh.  That'd be %SystemRoot%\System32\GroupPolicy\Machine\Scripts\Startup.
ASKER CERTIFIED SOLUTION
Avatar of stevenlewis
stevenlewis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey it worked stevenlewis!

this is the batch I run each time and it works great.

del E:\docume~1\user\locals~1\temp\*?.*
del E:\docume~1\user\cookies\*?.*
del E:\docume~1\user\cookies\index.dat
del E:\docume~1\user\locals~1\history\*?.*
del E:\docume~1\user\locals~1\history\history.ie5\index.dat
del E:\docume~1\user\locals~1\tempor~1\Content.IE5\3GGDPTES\*?.*
del E:\docume~1\user\locals~1\tempor~1\Content.IE5\EY56C3T6\*?.*
del E:\docume~1\user\locals~1\tempor~1\Content.IE5\G26H8JU3\*?.*
del E:\docume~1\user\locals~1\tempor~1\Content.IE5\WUYTROMT\*?.*

del E:\docume~1\Networ~1\locals~1\temp\*?.*
del E:\docume~1\Networ~1\cookies\*?.*
del E:\docume~1\Networ~1\cookies\index.dat
del E:\docume~1\Networ~1\locals~1\history\*?.*
del E:\docume~1\Networ~1\locals~1\history\history.ie5\index.dat
del E:\docume~1\Networ~1\locals~1\tempor~1\content.ie5\45IZO5QB\*?.*
del E:\docume~1\Networ~1\locals~1\tempor~1\content.ie5\AZ8TCJM7\*?.*
del E:\docume~1\Networ~1\locals~1\tempor~1\content.ie5\CLAJS5Y3\*?.*
del E:\docume~1\Networ~1\locals~1\tempor~1\content.ie5\CTYF8H2Z\*?.*

del E:\docume~1\locals~1\locals~1\tempor~1\content.ie5\8L6785YB\*?.*
del E:\docume~1\locals~1\locals~1\tempor~1\content.ie5\C5MB0XIN\*?.*
del E:\docume~1\locals~1\locals~1\tempor~1\content.ie5\O7S9EVSV\*?.*
del E:\docume~1\locals~1\locals~1\tempor~1\content.ie5\W5UNG5YF\*?.*
del E:\docume~1\locals~1\locals~1\history\history.ie5\index.dat
del E:\docume~1\locals~1\locals~1\history\*?.*
del E:\docume~1\locals~1\cookies\*?.*
del E:\docume~1\locals~1\cookies\index.dat
del E:\docume~1\locals~1\locals~1\temp\*?.*

del E:\docume~1\defaul~1\locals~1\tempor~1\content.ie5\45IZO5QB\*?.*
del E:\docume~1\defaul~1\locals~1\tempor~1\content.ie5\AZ8TCJM7\*?.*
del E:\docume~1\defaul~1\locals~1\tempor~1\content.ie5\CLAJS5Y3\*?.*
del E:\docume~1\defaul~1\locals~1\tempor~1\content.ie5\CTYF8H2Z\*?.*
del E:\docume~1\defaul~1\locals~1\history\history.ie5\index.dat
del E:\docume~1\defaul~1\locals~1\history\history.ie5\*?.*
del E:\docume~1\defaul~1\locals~1\history\*?.*
del E:\docume~1\defaul~1\cookies\*?.*
del E:\docume~1\defaul~1\cookies\index.dat
del E:\docume~1\defaul~1\locals~1\temp\*?.*

ok so it's a little overkill...
but it works like a charm every time (after a little tweaking).
DCJ
good web site as well
Glad I was able to help (found it while helping someone else here, another problem) and immediatly thought of this one
and yea, it is a good site
Steve