| View previous topic :: View next topic |
| Author |
Message |
kn1dmay1
Joined: 03 Nov 2009 Posts: 2
|
Posted: Tue Nov 03, 2009 3:55 pm Post subject: Including EXE in the bat file not working |
|
|
I am trying to include the exe file that the batch file is running in the compiled exe. Here is the batch file and psshutdown is the exe.
psshutdown -r -f -t 1 -u username -p password \\computername
I tried it as %MYFILES%\psshutdown.exe and with both start and call in front of it and it seems to not see psshutdown.exe in %MYFILES%
If I leave the psshutdown.exe in the same place as when I added it in the Compiler it works but I want this to be self supporting so I do not have to send the psshutdown.exe with the batch file.
Any suggestions?
Thanks |
|
| Back to top |
|
 |
|
|
kn1dmay1
Joined: 03 Nov 2009 Posts: 2
|
Posted: Tue Nov 10, 2009 8:10 pm Post subject: Fixed |
|
|
I fixed it by placing
C:\DOCUME~1\%USERNAME%\"Local Settings"\"Application Data"\
in front of the exe file and it worked.
You guys should really document the %MYFILES% better and also make it where you can set it to whatever path you want. |
|
| Back to top |
|
 |
support Site Admin
Joined: 13 Feb 2004 Posts: 299
|
Posted: Fri Nov 20, 2009 10:57 pm Post subject: |
|
|
Current version always use long file names, so you need to add quotes:
call "%MYFILES%\psshutdown.exe" |
|
| Back to top |
|
 |
blasch
Joined: 03 Sep 2009 Posts: 3
|
Posted: Sat Feb 20, 2010 8:16 pm Post subject: |
|
|
the long file names now affects %myfiles% calls in for loops...
still testing how to get around this...
bummer is I cannot update about 20 scripts until I figure this out.
Looks like you are pulling the APPDATA variable and mapping it to %Myfiles%
just a thought here, can you extract to a interative folder in appdata like qfb.000 qfb.001 etc... that way you can run multiple iterations of scripts that call %myfiles% and not step on the first scripts files. |
|
| Back to top |
|
 |
support Site Admin
Joined: 13 Feb 2004 Posts: 299
|
Posted: Tue Feb 23, 2010 10:18 pm Post subject: |
|
|
| Yes, we use APPDATA folder for embedded files. |
|
| Back to top |
|
 |
paolone
Joined: 11 Mar 2011 Posts: 2
|
Posted: Fri Mar 11, 2011 3:57 pm Post subject: |
|
|
| support wrote: | | Yes, we use APPDATA folder for embedded files. |
I'm not sure it really works on all NT-derived Windows version. I've already sent to support email address my concerns and suggestions, since I have a similar issue with a batch file I am trying to compile.
1. What I am trying to do
write a single program which accepts a path and a name file, and then uses embedded mkisofs.exe program to create a ISO.
2. My issues
A) I can get the program running on my 64-bit Windows 7 machine only by placing the %MYFILES% path under commas.
This way it works:
"%MYFILES%"\mkisofs.exe -o %2 -D -R -J ... etcetera
but if i just place
%MYFILES%\mkisofs.exe -o %2 -D -R -J ...
it doesn't
B) if I move my program to a server using Windows 2003 Server (which is basically the server version of Windows XP), it just doesn't work.
I added this debug line to my batch file:
| Quote: | | dir %MYFILES%\*.exe |
it should list mkisofs.exe if everything is fine. And, in effect, on my computer it outputs
| Quote: | Directory di C:\Users\paolone\AppData\Local
11/03/2011 12:22 128.512 mkisofs.exe
1 File 128.512 byte
0 Directory 47.030.542.336 byte disponibili |
which is OK. However, when running the same program on the Windows 2003 machine, the result is this:
| Quote: | | The system cannot find the path specified. |
I also tried ECHOing %MYFILES% to see what happens:
| Quote: | C:\tmp>echo %MYFILES%
%MYFILES% |
Morale ==> the %MYFILES% variable isn't set up correctly. This will lead my whole project not to run.
In my email I suggest to Abyssmedia a simple solution: Instead of use Windows' paths like /local/application-data or /appdata/etc, just
mkdir %USERPROFILE%/QBFTMP0000
set %MYFILES% %USERPROFILE%/QBFTMP0000
execute the script and then
rmdir %USERPROFILE%/QBFTMP0000
this should work on any version of Windows, starting from NT and upwards.
But if I am wrong, please tell me where and how to fix this, and I will be really happier.[/quote] |
|
| Back to top |
|
 |
paolone
Joined: 11 Mar 2011 Posts: 2
|
Posted: Fri Mar 11, 2011 4:29 pm Post subject: |
|
|
I've run the same project as-is on another Windows 2003 machine... and it works.
Astonishing.
I should look at permissions on the first machine, I think... |
|
| Back to top |
|
 |
|