Computer Hope

Microsoft => Microsoft DOS => Topic started by: squall_01 on March 24, 2009, 11:43:35 AM

Title: bat file error issue with programs
Post by: squall_01 on March 24, 2009, 11:43:35 AM
i want a bat to run defrag as part of the whole bat its self.  The thing is I have it as

echo off
disk defrag

exit

Is it cause it dont see the path or is it something else.
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 24, 2009, 11:44:42 AM
What is your defrag program called? Where is it located? What OS are you using?
Title: Re: bat file error issue with programs
Post by: squall_01 on March 24, 2009, 11:45:22 AM
the disk defrag in windows xp
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 24, 2009, 11:48:53 AM
Here ya go

Code: [Select]
C:\>defrag -?
Usage:
defrag <volume> [-a] [-f] [-v] [-?]
  volume  drive letter or mount point (d: or d:\vol\mountpoint)
  -a      Analyze only
  -f      Force defragmentation even if free space is low
  -v      Verbose output
  -?      Display this help text
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 11:28:42 AM
saing not reconized as an internal external command.  I put it as C:\>defrag -? to see if it would work before I added switches.  It had made a file called defrag on A: however
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 12:11:50 PM
1. post the exact batch file you used.

2. What happens if you type PATH at the command prompt?

3. Try C:\Windows\Defrag.exe

Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 12:20:19 PM
here's what is in the bat file simple

echo off

C:\Windows\Defrag.exe


exit

I cant figure out why its not going tried a combo of things.  I called it scanner.bat I'm not running it from cmd.  I tried even putting in a start thinking that would work
Title: Re: bat file error issue with programs
Post by: BC_Programmer on March 25, 2009, 12:22:10 PM
works for me.

What OS? I'd say XP based on your specs but we're all aware how often you neglect to specify the machine your running on...
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 12:23:20 PM
squall, why didn't you answer my other 2 questions?

Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 12:24:54 PM
works for me.

What OS? I'd say XP based on your specs but we're all aware how often you neglect to specify the machine your running on...

I expect he's running Sun Windows Ubuntu on a Kenwood DVD player.
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 12:25:47 PM
oh the other one sorry I havent tried that yet.  But I'm not useing one of my machines but the path should still be the same right>
Title: Re: bat file error issue with programs
Post by: BC_Programmer on March 25, 2009, 12:26:33 PM
it's quite simple, it's far easier to answer one question and trail off about other things that have been tried that likely will only make it worse.

I expect he's running Sun Windows Ubuntu on a Kenwood DVD player.


or on a Dell Compaq Emachine.


oh the other one sorry I havent tried that yet.  But I'm not useing one of my machines but the path should still be the same right>



No don't worry about, you know, answering the questions or anything. God knows we're just trying to make conversation.
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 12:28:53 PM
i dont know i did it this way tooo

echo off

C:\Windows\Defrag.exe

path=C:\Windows\Defrag.exe

exit
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 12:31:41 PM
OK, Squall, please try both of these before posting back.

1. Type PATH at the prompt, and copy and paste what you get. Something is wrong with your %path% variable. You are going to find plenty of other commands that do not work.

2. Type C:\Windows\system32\defrag.exe and press ENTER.

If you don't do both these things, I am out of here.




Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 12:34:51 PM
I'm not useing one of my machines but the path should still be the same right>


 ::)
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 12:57:04 PM
Is this the silence that ends a thread that means "I've realised what a *censored* I've been"?
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 01:40:18 PM
no i had to do other things.  sorry.  but I wont say anything about what you said I'll keep that to myself. 
Title: Re: bat file error issue with programs
Post by: BC_Programmer on March 25, 2009, 01:44:33 PM
well then, see- we just wanted a conversation. Just reminding ourselves what we would do in particular situations that just happened to coincide with yours is all.
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 01:54:16 PM
So did you make the defrag work?  ::)
Title: Re: bat file error issue with programs
Post by: BC_Programmer on March 25, 2009, 02:11:17 PM
do i need to check my paths on my trs-80 to run defrag? they should be the same right?
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 02:12:34 PM
I havent done it yet doing it know.
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 02:14:49 PM
the second works right off
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 02:16:26 PM
do i need to check my paths on my trs-80 to run defrag? they should be the same right?

Halouk says they should.
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 02:20:44 PM
the second works right off

But your PATH variable is screwed. So none of the Windows utils that you see below will work from the prompt like they should.

Code: [Select]
                              actmovie.exe                  ahui.exe                      alg.exe
append.exe                    arp.exe                       asr_fmt.exe                   asr_ldm.exe
asr_pfu.exe                   asuninst.exe                  at.exe                        ati2evxx.exe
Ati2mdxx.exe                  atmadm.exe                    attrib.exe                    auditusr.exe
autochk.exe                   autoconv.exe                  autofmt.exe                   autolfn.exe
blastcln.exe                  bootcfg.exe                   bootok.exe                    bootvrfy.exe
cacls.exe                     calc.exe                      certreq.exe                   certutil.exe
charmap.exe                   ChCfg.exe                     chkdsk.exe                    chkntfs.exe
cidaemon.exe                  cipher.exe                    cisvc.exe                     ckcnv.exe
cleanmgr.exe                  cliconfg.exe                  clipbrd.exe                   clipsrv.exe
clspack.exe                   cluster.exe                   cmd.exe                       cmdl32.exe
cmmon32.exe                   cmstp.exe                     CNAB4RPK.EXE                  CNMCP6e.exe
CNMCP78.exe                   comp.exe                      compact.exe                   comsdupd.exe
conime.exe                    control.exe                   convert.exe                   cscript.exe
csrss.exe                     ctfmon.exe                    dcomcnfg.exe                  ddeshare.exe
debug.exe                     defrag.exe                    dfrgfat.exe                   dfrgntfs.exe
dfscmd.exe                    diantz.exe                    diskpart.exe                  diskperf.exe
DivXCodecVersionChecker.exe   DivXsm.exe                    dllhost.exe                   dllhst3g.exe
dmadmin.exe                   dmremote.exe                  doskey.exe                    dosx.exe
dplaysvr.exe                  dpnsvr.exe                    dpvsetup.exe                  driverquery.exe
drwatson.exe                  drwtsn32.exe                  dsadd.exe                     dsget.exe
dsmod.exe                     dsmove.exe                    dsquery.exe                   dsrm.exe
dumprep.exe                   dvdplay.exe                   dvdupgrd.exe                  dwwin.exe
dxdiag.exe                    edlin.exe                     esentutl.exe                  eudcedit.exe
eventcreate.exe               eventtriggers.exe             eventvwr.exe                  exe2bin.exe
expand.exe                    extrac32.exe                  fastopen.exe                  faxpatch.exe
fc.exe                        find.exe                      findstr.exe                   finger.exe
Firefox Setup 2.0.exe         fixmapi.exe                   flac.exe                      accwiz.exe
fltmc.exe                     fontview.exe                  forcedos.exe                  freecell.exe
fsquirt.exe                   fsutil.exe                    ftp.exe                       gdi.exe
getmac.exe                    GkSui18.EXE                   gpresult.exe                  gpupdate.exe
grpconv.exe                   help.exe                      hostname.exe                  ie4uinit.exe
ieudinit.exe                  iexpress.exe                  imapi.exe                     imdisk.exe
imdsksvc.exe                  ipconfig.exe                  ipsec6.exe                    ipv6.exe
ipxroute.exe                  java.exe                      javaw.exe                     javaws.exe
jdbgmgr.exe                   jview.exe                     krnl386.exe                   label.exe
licmgr.exe                    lights.exe                    lnkstub.exe                   locator.exe
lodctr.exe                    logagent.exe                  logman.exe                    logoff.exe
logonui.exe                   lpq.exe                       lpr.exe                       lsass.exe
magnify.exe                   makecab.exe                   MAPISRVR.EXE                  mdm.exe
mem.exe                       metaflac.exe                  migpwd.exe                    mmc.exe
mmcperf.exe                   mnmsrvc.exe                   mobsync.exe                   mountvol.exe
mplay32.exe                   mpnotify.exe                  mqbkup.exe                    mqsvc.exe
mqtgsvc.exe                   mrinfo.exe                    MRT.exe                       mscdexnt.exe
msdtc.exe                     msfeedssync.exe               msg.exe                       mshearts.exe
mshta.exe                     msiexec.exe                   mspaint.exe                   MsPMSPSv.exe
msswchx.exe                   mstinit.exe                   mstsc.exe                     napstat.exe
narrator.exe                  nbtstat.exe                   nddeapir.exe                  net.exe
net1.exe                      netdde.exe                    netsetup.exe                  netsh.exe
netstat.exe                   NICFIND.EXE                   nlbmgr.exe                    nlsfunc.exe
notepad.exe                   nslookup.exe                  ntbackup.exe                  ntdsutil.exe
ntkrnlpa.exe                  ntoskrnl.exe                  ntsd.exe                      ntvdm.exe
nw16.exe                      nwscript.exe                  odbcad32.exe                  odbcconf.exe
OggDSuninst.exe               openfiles.exe                 osk.exe                       osuninst.exe
packager.exe                  pathping.exe                  PDBoot.exe                    pentnt.exe
perfmon.exe                   pgdfgsvc.exe                  ping.exe                      ping6.exe
PMounter.exe                  PowerCalc.exe                 powercfg.exe                  print.exe
progman.exe                   proquota.exe                  proxycfg.exe                  pxcpya64.exe
pxcpyi64.exe                  pxhpinst.exe                  pxinsa64.exe                  pxinsi64.exe
qappsrv.exe                   qprocess.exe                  QuickEdCleanReg.exe           qwinsta.exe
rasautou.exe                  rasdial.exe                   rasphone.exe                  rcimlby.exe
rcp.exe                       rdpclip.exe                   rdsaddin.exe                  rdshost.exe
recover.exe                   redir.exe                     reg.exe                       regedt32.exe
regini.exe                    regsvr32.exe                  regwiz.exe                    relog.exe
replace.exe                   reset.exe                     rexec.exe                     route.exe
routemon.exe                  rsh.exe                       rsm.exe                       rsmsink.exe
rsmui.exe                     rsnotify.exe                  rsopprov.exe                  rsvp.exe
rtcshare.exe                  RTLCPL.exe                    runas.exe                     rundll32.exe
runonce.exe                   rwinsta.exe                   savedump.exe                  sc.exe
scardsvr.exe                  schtasks.exe                  sdbinst.exe                   secedit.exe
services.exe                  sessmgr.exe                   sethc.exe                     setup.exe
setupn.exe                    setver.exe                    sfc.exe                       shadow.exe
share.exe                     shmgrate.exe                  shrpubw.exe                   shutdown.exe
sigverif.exe                  skeys.exe                     slrundll.exe                  slserv.exe
smbinst.exe                   smlogsvc.exe                  smss.exe                      sndrec32.exe
sndvol32.exe                  sol.exe                       sort.exe                      spdwnwxp.exe
spider.exe                    spiisupd.exe                  spnpinst.exe                  spoolsv.exe
SpoonUninstall.exe            sprestrt.exe                  spupdsvc.exe                  spupdwxp.exe
stimon.exe                    subst.exe                     svchost.exe                   SymTdiRg.exe
syncapp.exe                   sysedit.exe                   syskey.exe                    sysocmgr.exe
systeminfo.exe                systray.exe                   taskkill.exe                  tasklist.exe
taskman.exe                   taskmgr.exe                   TaskSwitch.exe                tcmsetup.exe
tcpsvcs.exe                   telnet.exe                    tftp.exe                      tlntadmn.exe
tlntsess.exe                  tlntsvr.exe                   tourstart.exe                 tracerpt.exe
tracert.exe                   tracert6.exe                  tsadmin.exe                   tscon.exe
tscupgrd.exe                  tsdiscon.exe                  tskill.exe                    tsshutdn.exe
TweakUI.exe                   typeperf.exe                  tzchange.exe                  unins000.exe
unlodctr.exe                  upnpcont.exe                  ups.exe                       user.exe
userinit.exe                  usrmlnka.exe                  usrprbda.exe                  usrshuta.exe
utilman.exe                   uwdf.exe                      verclsid.exe                  verifier.exe
vmnat.exe                     vmnetdhcp.exe                 vssadmin.exe                  vssvc.exe
vwipxspx.exe                  w32tm.exe                     wdfmgr.exe                    wextract.exe
wiaacmgr.exe                  winchat.exe                   WinFXDocObj.exe               winhlp32.exe
winlogon.exe                  winmine.exe                   winmsd.exe                    winspool.exe
winver.exe                    WISPTIS.EXE                   wjview.exe                    wowdeb.exe
wowexec.exe                   wpabaln.exe                   wpnpinst.exe                  write.exe
wscntfy.exe                   wscript.exe                   wuauclt.exe                   wuauclt1.exe
wupdmgr.exe                   xcopy.exe                     XX293116.EXE                  XX2953.EXE
XXCOPY.EXE                    XXCOPY16.EXE                  XXPBAR.EXE
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 02:24:38 PM
I'm on a network which mite be why with limitations.
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 03:06:45 PM
I'm on a network which mite be why with limitations.

So this isn't your own computer?
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 03:12:23 PM
no
Title: Re: bat file error issue with programs
Post by: Dias de verano on March 25, 2009, 03:41:39 PM
no

Duh! Like "Read this first!" "Give all information!" Now he tells us! Probably the admin has disabled users from starting defrags.
Title: Re: bat file error issue with programs
Post by: squall_01 on March 25, 2009, 03:48:12 PM
yes, didn't expect it too..... was thinking of home but doing it here so its like one of those duh moments.
Title: Re: bat file error issue with programs
Post by: squall_01 on April 01, 2009, 11:13:19 AM
Surpriseingly I got it work and it looks just like what you have posted.  I kind of want it to be gui use.  The help isnt all that helpful and I tried running it to no avial.  Also,  I want to know add avast and spybot but not sure what I have to point tooo.....  I looked for an exe but its not anything that I can see right off that would lanuch the programs.