jan_sc
06-18-2008, 07:45 PM
hi,
i've got a simple batch file (abc.bat) that does file renaming from a.dat to b.dat.
the batch file content as below:
cd "C:\test"
rename "a_*.dat" b.dat
exit
there is no problem on the batch file as it works when manually execute the batch file.
the problem only happens when i'm using ms access (vba) to execute the batch file.
the code to execute the batch file as below:
sFile = "C:\test\abc.bat"
Call Shell(sFile, vbHide)
i even tried with this code Call Shell(Environ$("COMSPEC") & " /c " & sFile, vbHide) also doesn't work.
however, i've tested the vba using ms access xp, it works but not on ms access 2k. could this be the problem? anyone have experienced such before?
thanks!
i've got a simple batch file (abc.bat) that does file renaming from a.dat to b.dat.
the batch file content as below:
cd "C:\test"
rename "a_*.dat" b.dat
exit
there is no problem on the batch file as it works when manually execute the batch file.
the problem only happens when i'm using ms access (vba) to execute the batch file.
the code to execute the batch file as below:
sFile = "C:\test\abc.bat"
Call Shell(sFile, vbHide)
i even tried with this code Call Shell(Environ$("COMSPEC") & " /c " & sFile, vbHide) also doesn't work.
however, i've tested the vba using ms access xp, it works but not on ms access 2k. could this be the problem? anyone have experienced such before?
thanks!