![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi Bjarne I fairly certain you have to wrap this line: stAppName = C:\Documents and Settings\Bjarne\Desktop\backupfile.bat stAppName = "C:\Documents and Settings\Bjarne\Desktop\backupfile.bat" |
#4
| |||
| |||
|
|
"Vacuum Sealed"<mclind1 (AT) bigpond (DOT) com> skrev i en meddelelse news:jWGzp.4248$aH5.1130 (AT) viwinnwfe02 (DOT) internal.bigpond.com... Hi Bjarne I fairly certain you have to wrap this line: stAppName = C:\Documents and Settings\Bjarne\Desktop\backupfile.bat stAppName = "C:\Documents and Settings\Bjarne\Desktop\backupfile.bat" Thx for answer... I tried this, but with same result... Strange problem, when i click on the .bat file on the Desktop it all works fine... Bjarne |
#5
| |||
| |||
|
|
Just to confirm. You did something like the following to wrap the string in quotes. stAppName = Chr(34) & CurrentProject.Path & "\backupfile.bat" & Chr(34) Call Shell(stAppName, 1) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 5/15/2011 5:33 AM, bsn wrote: "Vacuum Sealed"<mclind1 (AT) bigpond (DOT) com> skrev i en meddelelse news:jWGzp.4248$aH5.1130 (AT) viwinnwfe02 (DOT) internal.bigpond.com... Hi Bjarne I fairly certain you have to wrap this line: stAppName = C:\Documents and Settings\Bjarne\Desktop\backupfile.bat stAppName = "C:\Documents and Settings\Bjarne\Desktop\backupfile.bat" Thx for answer... I tried this, but with same result... Strange problem, when i click on the .bat file on the Desktop it all works fine... Bjarne |
#6
| |||
| |||
|
|
Just to confirm. You did something like the following to wrap the string in quotes. stAppName = Chr(34) & CurrentProject.Path & "\backupfile.bat" & Chr(34) Call Shell(stAppName, 1) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 5/15/2011 5:33 AM, bsn wrote: "Vacuum Sealed"<mclind1 (AT) bigpond (DOT) com> skrev i en meddelelse news:jWGzp.4248$aH5.1130 (AT) viwinnwfe02 (DOT) internal.bigpond.com... Hi Bjarne I fairly certain you have to wrap this line: stAppName = C:\Documents and Settings\Bjarne\Desktop\backupfile.bat stAppName = "C:\Documents and Settings\Bjarne\Desktop\backupfile.bat" Thx for answer... I tried this, but with same result... Strange problem, when i click on the .bat file on the Desktop it all works fine... Bjarne |
#7
| |||
| |||
|
|
Actually, I believe you need to use the command line interpreter in order to run batch files. Try: stAppName = Chr$(34) & Environ(%comspec%) & Chr$(34) & " " & _ Chr$(34) & CurrentProject.Path & "\backupfile.bat" & Chr$(34) Call Shell(stAppName, 1) Because Chr$(34) puts double quotes around the filename, there's no need to worry about it being less than 8 characters. "bsn" wrote in message news:4dcfeec5$0$56780$edfadb0f (AT) dtext02 (DOT) news.tele.dk... Thx for answer... Ur suggestion are not working - same result... No I did this way, with same result as u write about ... """" & CurrentProject.Path & "\bufile.bat" & """" As u see i have shorten the filename to under 8 chars to... another hint i found on the internet... but its still not working...8-( Bjarne "John Spencer" <JSPENCER (AT) Hilltop (DOT) umbc> skrev i en meddelelse news:iqom3d$3bm$1 (AT) dont-email (DOT) me... Just to confirm. You did something like the following to wrap the string in quotes. stAppName = Chr(34) & CurrentProject.Path & "\backupfile.bat" & Chr(34) Call Shell(stAppName, 1) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 5/15/2011 5:33 AM, bsn wrote: "Vacuum Sealed"<mclind1 (AT) bigpond (DOT) com> skrev i en meddelelse news:jWGzp.4248$aH5.1130 (AT) viwinnwfe02 (DOT) internal.bigpond.com... Hi Bjarne I fairly certain you have to wrap this line: stAppName = C:\Documents and Settings\Bjarne\Desktop\backupfile.bat stAppName = "C:\Documents and Settings\Bjarne\Desktop\backupfile.bat" Thx for answer... I tried this, but with same result... Strange problem, when i click on the .bat file on the Desktop it all works fine... Bjarne |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
try with: cmd /k or ...Environ(%comspec%)& " /k" ... Yoy will have to close the window manually - or else finalize the command with "&pause&exit" I believe it's also possible to use a 'silent' version: cmd /c but then the second parameter yo the shell call shall be vbMinimizedFocus (2) |
#10
| |||
| |||
|
|
Thx for answer... ...Environ(%comspec%) & " /k"... gives an error : "File not found" Bjarne "Benny Andersen" <a.mail.user (AT) gmail (DOT) com> skrev i en meddelelse news:4dd032e8$0$307$14726298 (AT) news (DOT) sunsite.dk... try with: cmd /k or ...Environ(%comspec%)& " /k" ... Yoy will have to close the window manually - or else finalize the command with "&pause&exit" I believe it's also possible to use a 'silent' version: cmd /c but then the second parameter yo the shell call shall be vbMinimizedFocus (2) |
![]() |
| Thread Tools | |
| Display Modes | |
| |