I have two functions, and both functions are working perfect in Windows 7 (on a citrix server), but now the system is migrated to Windows 10.
But now these two functions don't work now. I do not have a clue why this is not working now. Does someone see why it is not working on Win 10?
Code: Select all
searchFilesAndDuplicate()
{
Loop, Files, M:\HNG\_Shared\Breng-Planning\muurkranten\Muurkranten + Opkomststaten 308 en 151\AutoModus\*.*
{
FileGetTime, OutputVar, M:\HNG\_Shared\Breng-Planning\muurkranten\Muurkranten + Opkomststaten 308 en 151\AutoModus\*.*, M
FormatTime, DateCreated, %A_LoopFileTimeCreated%, dd-M-yyyy
FormatTime, CurrentDateTime,, dd-M-yyyy
if (CurrentDateTime = DateCreated)
{
if (!instr(A_LoopFileName,"_DPL"))
{
if (instr(A_LoopFileName,"308_OPK"))
{
i=1
Loop, 2
{
newFileName := substr(A_LoopFileName,1,-4)
newFileName .= "_DPL" . i . ".pdf"
FileCopy, % A_LoopFileFullPath, % "M:\HNG\_Shared\Breng-Planning\muurkranten\Muurkranten + Opkomststaten 308 en 151\AutoModus\" . newFileName
i++
}
}
i=1
if (instr(A_LoopFileName,"308_WEEK"))
{
newFileName := substr(A_LoopFileName,1,-4)
newFileName .= "_DPL" . i . ".pdf"
FileCopy, % A_LoopFileFullPath, % "M:\HNG\_Shared\Breng-Planning\muurkranten\Muurkranten + Opkomststaten 308 en 151\AutoModus\" . newFileName
}
i=1
if (instr(A_LoopFileName,"308_DAG"))
{
newFileName := substr(A_LoopFileName,1,-4)
newFileName .= "_DPL" . i . ".pdf"
FileCopy, % A_LoopFileFullPath, % "M:\HNG\_Shared\Breng-Planning\muurkranten\Muurkranten + Opkomststaten 308 en 151\AutoModus\" . newFileName
}
}
}
}
searchFilesAndDuplicate_Status_Message :=
(
"PDFs zijn succesvol gedupliceerd
Dit venster sluit binnen 3 seconden! "
)
msgbox,,PDFTK Status,%searchFilesAndDuplicate_Status_Message%,3
}
/**
* Functie collectPDFs
*
* Beschrijving: Verzamel alle PDFs van een bepaalde dag
* en creeër 1 grote PDF-file
*
*/
collectPDFs()
{
oneven_bat_Path := "H:\Settings\Desktop\AutoHotkey_1.1.33.10\Bat_files\oneven.bat"
blank_PDF_Path_Landscape := "H:\Settings\Desktop\AutoHotkey_1.1.33.10\PDFTK\blank_LS.pdf"
blank_PDF_Path_Portrait := "H:\Settings\Desktop\AutoHotkey_1.1.33.10\PDFTK\blank_PT.pdf"
Loop, Files, M:\HNG\_Shared\Breng-Planning\muurkranten\Muurkranten + Opkomststaten 308 en 151\AutoModus\*.*
{
FileGetTime, OutputVar, M:\HNG\_Shared\Breng-Planning\muurkranten\Muurkranten + Opkomststaten 308 en 151\AutoModus\*.*, M
FormatTime, DateCreated, %A_LoopFileTimeCreated%, dd-M-yyyy
FormatTime, CurrentDateTime,, dd-M-yyyy
if (CurrentDateTime = DateCreated)
{
PDF_IN = "%A_LoopFileFullPath%"
PDF_IN_Total .= PDF_IN A_Space
;checken of de file een oneven aantal paginas heeft
RunWait, %comspec% /c H:\Settings\Desktop\AutoHotkey_1.1.33.10\Bat_files\oneven.bat %PDF_IN%, , hide
;msgbox ErrorLev: %ErrorLevel%
if (ErrorLevel > 1) ;er ging wat mis??
{
SoundBeep, 1500
msgbox, something went wrong in Oneven (errorlevel for oneven.bat)
}
if (ErrorLevel = 1) ;errorlevel 1 is oneven
{
if (instr(PDF_IN,"WEEK") or instr(PDF_IN,"DAG")) ; Week en Dagplanning worden afgedrukt in Portrait
{
PDF_IN_Total .= """" blank_PDF_Path_Portrait """" A_Space
}
else
{
PDF_IN_Total .= """" blank_PDF_Path_Landscape """" A_Space ; Opkomststaten worden afgedrukt in Landscape
}
}
}
}
PDFKT_Path := "H:\Settings\Desktop\AutoHotkey_1.1.33.10\PDFTK\App\pdftkbuilder\pdftk.exe"
DateTomorrow := Add_Days_to_CurrentDate_ShortDate(1)
NewFile := "M:\HNG\_Shared\Breng-Planning\muurkranten\Muurkranten + Opkomststaten 308 en 151\AutoModus\" . "_Alle-PDFs-Samen-" . DateTomorrow . "_.pdf"
RunWait, %comspec% /c ""%PDFKT_Path%" %PDF_IN_Total% "output" "%NewFile%"", ,hide
if ErrorLevel > 0
{
SoundBeep, 3000
msgbox, Something went wrong in PDF_In_Total
}
Else
{
PDFTK_Status_Message :=
(
"PDFs zijn succesvol verzameld
Dit venster sluit binnen 3 seconden! "
)
msgbox,,PDFTK Status,%PDFTK_Status_Message%,3
}
}