Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Even robocopy doesn't work
#1
I don't want to seem picky, but... even ROBOCOPY from versions later than 3.12 doesn't work.

The program replicates itself infinitely, and if you are not quick to force it to close with CTRL+ALT+DELETE, the system freezes and then crashes.

To be honest... even in version 3.12, the command behaves strangely: it doesn't work 20 times (just to say it seems random) and then it works once.

ROBOCOPY is an important command; I will try to compile the executable with version 1.5... I have nothing left: I've tried everything!


Perhaps the problem encountered with the manipulation of the system dates is just the tip of the iceberg. Maybe it has to do with how QB64 connects, through SHELL, with the operating system commands.


In c:\robocopy there are some files that I would like to copy to c:\robocopy new while preserving the attributes.
The syntax is designed to allow for the handling of paths with empty spaces.


note: There are no spaces between COPY : DAT: I have to write it this way because the editor that formats the code writes COPYAT  !!

Code: (Select All)

o$ = "C:\robocopy"
d$ = "c:\robocopy new"

comando$ = "ROBOCOPY " + o$ + " " + CHR$(34) + d$ + CHR$(34) + " /COPY: DAT /E"
SHELL comando$

SYSTEM
Reply
#2
Maybe it depends on me not knowing the right syntax!

I wouldn't want to spread unjustified alarms... certainly, something also depends on the syntax of the POWERSHELL commands (which is really complex) and ROBOCOPY to be inserted in the SHELL... but the behaviors of the produced executables are bizarre.

And above all: why do they work in one version of QB64 and crash the system in another ?
Reply
#3
Code: (Select All)

o$ = "C:\robocopy"
d$ = "c:\robocopy new"

comando$ = "powershell -Command " + chr$(34) + "ROBOCOPY ' " + o$ + " ' ' " + CHR$(34) + d$ + CHR$(34) + "' /COPY : DAT /E" + chR$(34)
SHELL comando$

SYSTEM

It seems to work this way (specifying that ROBOCOPY is a PowerShell command).
If you open a DOS window and use the normal CMD from the command line, it works without any need for specification (which is why the first version didn't specify anything). In any case, specifying nothing and compiling in QB64 causes the execution to crash the system.

I hope I'm not adding confusion
Hmm! I'm getting lost...
Reply
#4
In these situations, it sometimes helps to use 'cmd /c' in front:
SHELL "cmd /c " + comando$
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply




Users browsing this thread: 1 Guest(s)